Virtual Hosting Problems

Don Erickson derick at shark.zeni.net
Wed Apr 16 14:59:49 CDT 2003


In article <20030416024507.99104.qmail at web40808.mail.yahoo.com> you write:

>Sometime ago I had a problem with getting Virtual
>Hosting on Apache 1.3.27 to work properly. I don't
>know what I'm doing wrong. I believe I'm configuring
>the server correctly:

What I am doing on Apache 1.3.27, which does work, is the following (from
your examples)...

NameVirtualHost 192.168.2.50

<VirtualHost www.kcmultiservice.com>
        ServerName www.kcmultiservice.com
	ServerAdmin wilsan816 at yahoo.com
        DocumentRoot /home/kcmultiservices/www/
</VirtualHost>

<VirtualHost www.bluekc.com>
        ServerName www.bluekc.com
        ServerAdmin wilsan816 at yahoo.com
        DocumentRoot /home/bluekc/www/
</VirtualHost>

So, I'm using the name rather than the IP in the VirtualHost directive,
and I believe that appending the trailing slash to the Document Root keeps
apache from redirecting which is infintessimally faster and gives cleaner
logs.

I don't understand the point of the "default" directive, but suspect that
it may be part of the problem.  If you just try to load the IP address
from the browser, you will obviously get whatever apache perceives as it's
default page.  

I really think that using the names as above will solve your problem.

As I recall, the first virtual host is treated as a default by apache, but
it has been a while since I dealt with this issue.

>This server is on a LAN that's behind a
>firewall/router I built using iptables. Everything is
>forwarding (nating). Now, I don't know if all the HTTP
>headers are being forwarded to the server or not. I
>ran ethereal on that side of the LAN and when I
>selected "Follow TCP Stream" I see the address I am
>requesting. 

I can not imagine why NAT would be stripping headers.  This is strictly an
apache issue.  

>I don't know what to do, I am getting frustrated with
>this. Please help. Apologies for the long post.

Hang in there, you're almost home.

Regards,

-Don




More information about the Kclug mailing list