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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serveral names, one server

Status
Not open for further replies.

ManagerJay

IS-IT--Management
Jul 24, 2000
302
US
A couple of the local scouting organizations have asked me to host web sites for them. Since I only have a dial-up connection, I registered two names with DynDNS scouting1.homelinux.net and scouting2.homelinux.net.

No matter whether the sites are connected to using the scouting1.homelinux.net or the scouting2.homelinux.net the same web page (the homepage for scouting1 is displayed (yes they are different).

Following is an excerpt from my Apache configuration file.

NameVirutalHost 10.129.10.40
<VirtualHost 10.129.10.40>
ServerName scouting1.homelinux.net
DocumentRoot /hdd2/</VirtualHost>

<VirtualHost 10.129.10.40>
ServerName scouting2.homelinux.net
DocumentRoot /hdd2/</VirutalHost>

I'm sure I have missed something here that is readily obvious, but I'm not seeing it. Any help would be greatly appreciated.

Thanks in advance for your assistance.



Jay
 
This should be set to off.

UseCanonicalName Off

On some distros it works when it's left in the global definitions others may have to put this line in each vhost container.
 
Thanks. I had set it in the Global option and it was not working. However setting it in each vhost container made it work.

Thanks again for all your help.



Jay
 
OK. I have enrything laid out now, and I was going to put it on the web this afternoon, but the scouting1.homelinux.net page is displayed for everyone, even if they go to scouting2.homelinux.net.

However, if I try to access the pages from my local network, everything displays correctly.

What sould I look for now? I have tried setting up the sites using * the VirtualHost name, but have had no luck.

Other than the * and adding Use CanonialName Off to the virutal hosts container, everything is the same as it was above.

Thanks in advance for your assistance.



Jay
 
I think I see the problem now, but I'm not sure how to solve it. My network configuration consists of eth0 assigned a 10.X.X.X address and the ppp interface is assigned an IP address dynamically through my ISP. The IP address is then registered with dyndns.org. This seemed like the easiest way to do this since dial-up is the only type of connection available in my area.

I have the ServerName, the NameVirtualHost and the VirtualHost all set to the 10.X.X.X so, if my understanding is correct, the VirtualHosts are not binding to to the ppp interface (just the 10.X.X.X). I have tried using Virtual Host * with no success. The default page is displayed for all the external clients.

Any suggestions as to what should be checked would be greatly appreciated.



Jay
 
Hi,

The '*' effectively means all active IP addresses or all interfaces and it should work. This only works for versions of apache after 1.3.12, however, so you might want to check thats not a problem.

NameVirtualHost *

<VirtualHost *>
UseCanonicalName off
ServerName DocumentRoot /var/</VirtualHost>

etc..

You would presumably have to restart apache after any change of IP address too. I'd guess that your apache server starts before you go online. Have you tried to do a restart after you get online - e.g. as root

/etc/rc.d/init.d/httpd restart

or

/usr/local/apache/bin/apachectl restart

(depending on how you installed )

Hope this helps
 
Thanks to everyone for the help. I downloaded the source and re-compiled and everything is working just like it should now.

Thanks again for all your help.



Jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top