Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host access via IP Address

Status
Not open for further replies.

petebud

Technical User
Jan 6, 2005
2
US
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 and it would take me to the documents i had for company1
I could enter my domain name 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 /ServerName 222.222.222.1
</VirtualHost>

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

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

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

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

Thanks
Pete
petebud@yahoo.com
 
Should this read
Code:
<VirtualHost [b]222.222.222.1:80[/b]>
ServerAdmin me@me.com
DocumentRoot /[URL unfurl="true"]www/domain.com[/URL]
ServerName [URL unfurl="true"]www.domain.com[/URL]
</VirtualHost>

[URL unfurl="true"]http://unixjunky.com[/URL]
 
It is working just fine now, by entering my domain names ( or it loads the correct pages from each of those folders. But i can not get apache working as it was before, (before what, i dont know, it was working then just stopped 1 day)

I want to be able to enter my real world IP addresses and access seperate folders from those accessed when i enter my doamin names.

Thanks
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top