Virtual Hosting Problems

Gerald Combs gerald at ethereal.com
Wed Apr 16 15:41:21 CDT 2003


On Wed, 16 Apr 2003, Jonathan Hutchins wrote:

> As adam said, I would replace the explicit IP numbers with asterisks for now.  
> That feature is most useful when you select virtual host by IP.
> 
> I'm not familiar with the "NameVirtualHost" feature, but if I'm not mistaken it 
> looks like it's bumping your virtual hosts to alternate ports - ports 1000-
> 1026, which might explain why you can't reach them.  On my multi-host system I 
> did this without that parameter and it works just fine.  Mine is firewalled but 
> not NAT'ed, which shouldn't make a difference.

"NameVirtualHost" designates a specific IP address to be used for
name-based virtual hosts (as the name would imply):

    http://httpd.apache.org/docs/mod/core.html#namevirtualhost

I think the numbers 1000, 1026, etc. in the output of 'httpd -S' refer to
lines in the configuration file, and not to ports that the server is
listening to.  The output is confusing in that regard.  (If Apache pushed
the first server to port 1000, he probably wouldn't be able to connect
from the outside at all through his firewall).

Jose, I'm using a configuration similar to yours on several servers.  I
have

NameVirtualHost a.b.c.d

<VirtualHost a.b.c.d>
Include /web/www.site.com/apache.conf
</virtualHost>

[ More VirtualHost entries ]

It's been working well for me for several years.  The things I'm doing
differently are:

  - I don't have a "_default_" entry.

  - I'm using "Include" directives so that I can keep separate config
    files for each site.

  - For duplicate entries, e.g. "site.com" and "www.site.com" I only have
    one config, with "ServerName www.site.com" and "ServerAlias site.com",
    whereas you have two separate VirtualHost entries.

You might try commenting out the "_default_" entry, and merge your
"kcmultiservice" entries as follows:

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

BTW, what URLs are you using to test?  In your original message, you
mentioned that you captured the TCP session during your test.  Did the
client actually send the line

Host: www.albertopujols.com

when you went to that site?

BTW2, you can test manually using telnet:

-> telnet 192.168.2.50
<- Connected to 192.168.2.50.
<- Escape character is '^]'.
-> GET / HTTP/1.0
-> Host: www.albertopujols.com
-> [ hit return ]

BTW3, when I connect to each site manually from the outside, I get a
response from an IIS server.  Is DNS and NAT configured correctly?




More information about the Kclug mailing list