I have followed all the steps from https://medium.com/@JohnFoderaro/how-to-set-up-apache-in-macos-sierra-10-12-bca5a5dfffba#.scwat9ihp to start my web server . Need help
On running apachectl -S
VirtualHost configuration:
ServerRoot: "/usr/local/opt/httpd24"
Main DocumentRoot: "/usr/local/var/www/htdocs/"
Main ErrorLog: "/usr/local/var/log/apache2/error_log"
Mutex default: dir="/usr/local/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/usr/local/var/run/apache2/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="daemon" id=1 not_used
Group: name="daemon" id=1 not_used
I have changed /etc/apache2/httpd.conf
#ServerName www.example.com:80
ServerName localhost
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
DocumentRoot "Users/{{username}}/Sites/"
<Directory "Users/{{username}}/Sites/">
I have added private/etc/apache2/extra/httpd-vhosts.conf
#Virtual Host Entry for foo.localhost
<VirtualHost *:80>
DocumentRoot "/Users/{{username}}/Sites/foo"
ServerName foo.localhost
ErrorLog "/private/var/log/apache2/foo-error_log"
CustomLog "/private/var/log/apache2/foo-access_log" common </VirtualHost>
#Virtual Host Entry for bar.localhost
<VirtualHost *:80>
DocumentRoot "/Users/{{username}}/Sites/bar"
ServerName bar.localhost
ErrorLog "/private/var/log/apache2/bar-error_log"
CustomLog "/private/var/log/apache2/bar-access_log" common
</VirtualHost>
But apache seems to run index.html file on '/usr/local/var/www/htdocs/' instead of "Users/{{username}}/Sites/"