Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 12
Trades: 0
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
 
 
Register now for full access!
Old 07-18-2005, 09:28 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.54041 seconds with 12 queries