Why can I only have one virtual host?
My site on http://localhost is just fine. My first virtual host, as specified in httpd-vhosts.conf
is just fine ... but when I add a second, just a variant with an extra letter tacked on, Apache doesn't seem to try to serve it.
I did restart Apache after editing the file (Xampp on Windows 7)
My httpd-vhosts.conf
says
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "o:/abc"
ServerName abc
ErrorLog "logs/abc-error.log"
CustomLog "logs/abc-access.log" combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "o:/abc2"
ServerName abc2
ErrorLog "logs/abc2-error.log"
CustomLog "logs/abc2-access.log" combined
</Vi开发者_开发百科rtualHost>
<VirtualHost *:80>
DocumentRoot "f:/htdocs"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" combined
</VirtualHost>
When I access http://lcoalhost or http://abc, everything is fine. When I try to access http://abc2 (the local directory does exist) my browser tries to load http://www.abc2.com
What might I be doing wrong?
Did you specify abc2
in your hosts
file?
精彩评论