PHPForever
n00b
- Joined
- Jan 11, 2005
- Messages
- 22
Well, just when I tought I knew everything about Virtual Hosts.... to the question.
I have two websites hosted on my Apache server as vhosts. They both work fine.
Here are the entries in the httpd.conf file (substituting site1 and site2 for the real domains - I'm ashamed of my websites)
NameVirtualHost *:80
<VirtualHost *:80>
ServerName site1.com
DocumentRoot C:/wwwroot/site1/wwwpublic
ErrorLog C:/wwwroot/site1/logs/errorlog
</VirtualHost>
<VirtualHost *:80>
ServerName site2.com
DocumentRoot C:/wwwroot/site2.com/wwwpublic
ErrorLog C:/wwwroot/ site2.com/logs/errorlog
</VirtualHost>
Now I have registered another domain, in this case site3.com which is pointing to the server's IP address. site3.com does not have a vhost entry yet. What was unexpected is that when I visit site3.com apache answers with site1.com. If I switch the order of the vhost entries, then apache answers with site2.com. Is that behaviour normal? Please explain.
I have two websites hosted on my Apache server as vhosts. They both work fine.
Here are the entries in the httpd.conf file (substituting site1 and site2 for the real domains - I'm ashamed of my websites)
NameVirtualHost *:80
<VirtualHost *:80>
ServerName site1.com
DocumentRoot C:/wwwroot/site1/wwwpublic
ErrorLog C:/wwwroot/site1/logs/errorlog
</VirtualHost>
<VirtualHost *:80>
ServerName site2.com
DocumentRoot C:/wwwroot/site2.com/wwwpublic
ErrorLog C:/wwwroot/ site2.com/logs/errorlog
</VirtualHost>
Now I have registered another domain, in this case site3.com which is pointing to the server's IP address. site3.com does not have a vhost entry yet. What was unexpected is that when I visit site3.com apache answers with site1.com. If I switch the order of the vhost entries, then apache answers with site2.com. Is that behaviour normal? Please explain.