5
I'm running Apache 2.4 on Yosemite
This is my /private/etc/apache2/httpd.conf
ServerName 127.0.0.1:80
DocumentRoot "/Library/WebServer/Documents/home_www/"
<Directory "/Library/WebServer/Documents/home_www">
Options Multiviews FollowSymLinks
MultiviewsMatch Any
AllowOverride All
Order allow,deny
Allow from all
</Directory>
With this setting I can use http://127.0.0.1
and http://localhost
in the web browser then it directs me to /Library/WebServer/Documents/home_www/index.html
as usual
Then I added Include /private/etc/apache2/extra/httpd-vhosts.conf
because I would like to use vhost on my machine
This is my /private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin jeud@hotmail.com
ServerName tutor4dev.local
DocumentRoot "/Library/WebServer/Documents/home_www/xxx"
</VirtualHost>
I tried to use sudo apachectl -S
to display vhost configuration, there are the result
VirtualHost configuration:
*:80 xxx.local (/private/etc/apache2/extra/httpd-vhosts.conf:28)
ServerRoot: "/usr"
Main DocumentRoot: "/Library/WebServer/Documents/home_www/"
Main ErrorLog: "/private/var/log/apache2/error_log"
Mutex proxy: using_defaults
Mutex default: dir="/private/var/run/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/private/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="_www" id=70
Group: name="_www" id=70
I can use http://xxx.local
to access /Library/WebServer/Documents/home_www/xxx/index.html
(vhost), but after adding vhost, http://127.0.0.1
and http://localhost
also direct me to /Library/WebServer/Documents/home_www/xxx/index.html
instead of /Library/WebServer/Documents/home_www/index.html
Please guide how to fix it Thanks