virtualhost not working properly
i set up 2 virual hosts:
httpd-v开发者_StackOverflowhosts.conf
NameVirtualHost *:81
NameVirtualHost *:82
....
<VirtualHost *:81>
ServerName krmsrv05
# ServerAlias krmsrv05
DocumentRoot "C:/xampp/htdocs"
# ServerAdmin postmaster@krmsrv05
# ErrorLog "logs/localhost-error.log"
# CustomLog "logs/localhost-access.log" combined
</VirtualHost>
<VirtualHost *:82>
ServerName krmsrv05
# ServerAlias pprod.krmsrv05
DocumentRoot "C:/xampp/htdocs/portail_zf"
# SetEnv APPLICATION_ENV "development"
<Directory "C:/xampp/htdocs/portail_zf">
DirectoryIndex index.php
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
httpd.conf
Listen 81
Listen 82
...
ServerName krmsrv05
my problem is the second Vhost(port 82) works but the first one no :(
no error messages given by apache (...)i need your help
many thanx :) (sorry for my bad english)I'm not sure but it may have something to do with your firewall. I've never personally used anything other that 80. Unless you have a specific need that requires you to use different ports I would recommend you only use port 80 or 8080. You have all of your virtual hosts using the same port you just have to use a different ServerName. Also make sure in your etc hosts file you add:
127.0.0.1 servername.com
Where servername.com is what you put next to ServerName in your vhost file. I recommend using a .com at the end of the servername otherwise I've found that browsers will treat your url request as if you're trying to search google.
I hope that helps. Let me know if I didn't understand your question or I didn't make myself clear :) Cheers!
精彩评论