Forum Moderators: phranque

Message Too Old, No Replies

Virtual Host access via IP address

Virtual Host access via IP address

         

petebud

9:46 pm on Jan 6, 2005 (gmt 0)



Red Hat 9 - Apache 2

I once had my apache working in the following manner.

I could enter my IP address (say 222.222.222.1)and it would take me to the documents i had under USER1
I could also enter my 2nd IP address (say 222.222.222.2) and it would take me to the documents i had under USER2
I could enter my domain name www.company1.com and it would take me to the documents i had for company1
I could enter my domain name www.company2.com and it would take me to the documents i had for company2

But now only my domain names work, if i try to start apache with an IP address in the ServerName Directive it fails.

Here is the VirtualHost section as it was before it stopped working:

NameVirtualHost *

<VirtualHost *>
ServerAdmin me@me.com
DocumentRoot /www/docs/user1
ServerName 222.222.222.1
</VirtualHost>

<VirtualHost *>
ServerAdmin me@me.com
DocumentRoot /www/docs/user2
ServerName 222.222.222.2
</VirtualHost>

<VirtualHost *>
ServerAdmin me@me.com
DocumentRoot /www/docs/company1
ServerName www.company1.com
</VirtualHost>

<VirtualHost *>
ServerAdmin me@me.com
DocumentRoot /www/docs/company2
ServerName www.company2.com
</VirtualHost>

Is this still possible? Was it a fluke that i had it working the 1st time?

Thanks
Pete

[edited by: jdMorgan at 10:21 pm (utc) on Jan. 6, 2005]
[edit reason] No e-mail/sigs, please. See TOS. [/edit]