Apache VirtualHost - http://www. problem
Hi all,
I have installed Apache (httpd 2.2.0) on my Fedora 5. When i type http://www.myname.mydomain.com or http://myname.mydomain.com URL in browser it works fines. But when I type http://www.yourname.mydomain.com in browser it is not displaying any page, while http://yourname.mydomain.com link works fine. I have same problem with http://www.ourname.mydomain.com Can you please help me to find why “www” is only working with first entry and is not working for 2nd and 3rd virtualhost entry? My httpd.conf file is as below. ----------------------------------------------------------------------------- . . ServerName localhost:80 (also tried www.myname.mydomian.com) . . DocumentRoot "/Data/html" . . NameVirtualHost *:80 . . <VirtualHost *:80> ServerName www.myname.mydomain.com ServerAlias myname.mydomain.com DocumentRoot "/Data/html/myname" </VirtualHost> <VirtualHost *:80> ServerName www.yourname.mydomain.com ServerAlias www.yourname.mydomain.com yourname.mydomain.com DocumentRoot "/Data/html/yourname" </VirtualHost> <VirtualHost *:80> ServerName www.ourname.mydomain.com ServerAlias www.ourname.mydomain.com ourname.mydomain.com DocumentRoot "/Data/html/ourname" </VirtualHost> |
Apache isn't reading the second entry. Try one alias per line.
ServerAlias 1 ServerAlias 2 |
Why the " at the end of your DocumentRoot statements?
|
leandean,
I tried creating 2 alias as you said but it not working. ServerAlias www.yourname.mydomain.com ServerAlias yourname.mydomain.com and billymayday " was the typo error in DocumentRoot statements. |
Do you have all these hostnames specified in your /etc/hosts file or on a DNS server? Otherwise the browser is trying to find an actual host on the internet with that name.
try to ping each of the hostnames in turn and see if they all point to your virtual server. |
I tried
# dig www.myname.yourdomain.com and found there is problem with DNS entry. I add entry in DNS and now site is working fine. Thank you for all your help. |
All times are GMT -5. The time now is 08:30 PM. |