I have a problem using the build-in apache webserver under ElCapitan.
I want to set up my Sites-Directory in my users-directory. This works fine by adding a user config and and so on. So my localhost/~Fabian gives me the content of /User/Fabian/Sites/index.php.
Now I am trying to set up virtual hosts in this directory, e.g. /User/Fabian/Sites/Projekte/testsite.me/public.
So I activated the virtualhost module and included it in my httpd.conf. After this, I set up a virtualhost in the httpd-vhost.conf:
</VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Users/Fabian/Sites/Projekte/testsite.me/public"
ServerName testsite.me
ErrorLog "/Users/Fabian/Sites/Logs/testsite-error_log"
CustomLog "/Users/Fabian/Sites/Logs/testsite-custom_log" common
</VirtualHost>
I also added the ServerAlias to my hosts file
127.0.0.1 testsite.me
Trying to open http://testsite.me shows me the default "It works"-page.
Running apachectl configtest gives me an syntax error:
httpd: Syntax error on line 499 of /private/etc/apache2/httpd.conf: Syntax error on line 74 of /private/etc/apache2/extra/httpd-vhosts.conf: </VirtualHost without matching <VirtualHost section
Line 499 in httpd.conf looks like this:
Include /private/etc/apache2/extra/httpd-vhosts.conf
Line 74ff of httpd-vhosts.conf contain the virtualhost I defined above.
Any idea how to solve this problem? What is a VirtualHost section?
Thank you!