Apache (xampp) doesn't work when I change ServerName in VirtualHost
The issue:
Everything works fine all until I change the name of 'dev' into anything else, i.e.'devo'. Error logs say s'could not resolve host name'. The 'dev' site is done with PHP Symfony.
What I tried doing:
开发者_开发知识库- Someone before has setup it up, so I removed everything, and copied over the project again, reinstalled XAMPP, rewrote the vhosts file, but the issue remained.
- I checked my Firefox and IE settings and there's no special rules in LAN settings.
- I tried clearing my browsers cache.
My Question is: How can a change of hostname screw everything up?
Contents of my httpd-vhosts.conf:
NameVirtualHost 127.0.0.1:80
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "C:\xampp\htdocs"
</VirtualHost>
<VirtualHost dev:80>
ServerName dev
DocumentRoot "C:\workspace\trunk\web"
</VirtualHost>
About the same as this question.
Although for you, it's %WINDIR%\System32\drivers\etc\hosts
.
I guess your machine's name is dev
and can hence be resolved. Any other hostname (or ServerName
for that matter) needs to show up in the hosts
file so it can be resolved to an IP address.
What about names resolution (check your hosts)? Does your pc ping devo to localhost? Anyway, you can also use ServerAlias to specify more than one name for a specific installation.
精彩评论