Reply
Virtual Host help
Old 07-14-2005, 10:40 AM Virtual Host help
Novice Talker

Posts: 12
I have two .com domain trying to use virtual host file to redirect site but it is only going to the first site regardless of which domain name entered any assistance will be greatly appreciated

NameVirtualHost 192.168.1.100 #external ip
NameVirtualHost 192.168.1.4 #internal ip


<VirtualHost 192.168.1.100 192.168.1.4>

ServerAdmin webmaster@site1.com
ServerName www.site1.com
DocumentRoot /var/www/html

<Directory />
Options +Includes
</Directory>

ErrorLog /var/www/html/logs/error.log
CustomLog /var/www/html/logs/access.log combined


</VirtualHost>
<VirtualHost 192.168.1.100 192.168.1.4>

ServerAdmin webmaster@site2.com
ServerName www.site2.com
DocumentRoot /var/www/html/site2

<Directory />
Options +Includes
</Directory>

ErrorLog /var/www/html/site2/logs/error.log
CustomLog /var/www/html/site2/logs/access.log combined

</VirtualHost>

Last edited by tke248 : 07-14-2005 at 10:56 AM.
tke248 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 07-18-2005, 09:28 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
each virtual host should have only 1 entry

E.G
Code:
NameVirtualHost 192.168.0.100:80

<VirtualHost dev.dummy-site1.co.uk:80>
    ServerAdmin ibbo@localhost
    DocumentRoot /home/dummy-site1/public_html
    ServerName dev.dummy-site1.co.uk
</VirtualHost>

<VirtualHost dev.dummy-site2.co.uk:80>
    ServerAdmin ibbo@localhost
    DocumentRoot /home/dummy-site2/public_html
    ServerName dev.dummy-site2.co.uk
</VirtualHost>
So if both your domains point to this server then your registered domain names can be added to your hosts file and implemented as above.

How do you have 2 ip addresses 1 external and 1 internal, is your machine a gateway/ router? these IP ranges are for a subnets.

I also would have assumed that apache would have fallen over with your configuration, are you on windows or *nix? either way swap your multiple ip entries with a single host name (but remember your initial Virtual host directive. This allows for any connection to that IP to be parsed down there in your Virtual hosts directives.

Ibbo
__________________
www.nationalclubgolfer.com www.sportspub.co.uk www.bespokecc.co.uk www.centralmarquees.co.uk
Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to Virtual Host help
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11810 seconds with 12 queries