Virtual Hosting Problems

Brian Densmore DensmoreB at ctbsonline.com
Wed Apr 16 15:01:01 CDT 2003


Try this:

NameVirtualHost 192.168.2.50

<VirtualHost _default_:*>
           DocumentRoot /home/httpd/html
</VirtualHost>

<VirtualHost www.kcmultiservice.com>
        ServerName www.kcmultiservice.com
        ServerAdmin wilsan816 at yahoo.com
        DocumentRoot /home/kcmultiservices/www
</VirtualHost>
 
#redundant
# <VirtualHost kcmultiservice.com>
#         ServerName 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>
 
<VirtualHost www.albertopujols.com>
         ServerName www.albertopujols.com
         ServerAdmin wilsan816 at yahoo.com
         DocumentRoot /home/albertopujols/www
</VirtualHost>

It's called name virtual hosts because 
you are supposed to use names and not numbers.

Anyway that is how my httpd.conf file was when I had virtual hosts.

> -----Original Message-----
> From: jose sanchez [mailto:j_r_sanchez at yahoo.com]
> Sent: Tuesday, April 15, 2003 9:45 PM
> To: kclug at kclug.org
> Subject: Virtual Hosting Problems
> 
> 
> Hello:
> 
> 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:
> 
> NameVirtualHost 192.168.2.50
> 
> <VirtualHost _default_:*>
>            DocumentRoot /home/httpd/html
> </VirtualHost>
> 
> <VirtualHost 192.168.2.50>
>         ServerName www.kcmultiservice.com
>         ServerAdmin wilsan816 at yahoo.com
>         DocumentRoot /home/kcmultiservices/www
> </VirtualHost>
> 
> <VirtualHost 192.168.2.50>
>         ServerName kcmultiservice.com
>         ServerAdmin wilsan816 at yahoo.com
>         DocumentRoot /home/kcmultiservices/www
> </VirtualHost>
> 
> <VirtualHost 192.168.2.50>
>         ServerName www.bluekc.com
>         ServerAdmin wilsan816 at yahoo.com
>         DocumentRoot /home/bluekc/www
> </VirtualHost>
> 
> <VirtualHost 192.168.2.50>
>         ServerName www.albertopujols.com
>         ServerAdmin wilsan816 at yahoo.com
>         DocumentRoot /home/albertopujols/www
> </VirtualHost>
> 
> 
> Now, when I enter this command (httpd -S), this is
> what I get:
> 
> VirtualHost configuration:
> 192.168.2.50:80        is a NameVirtualHost
>                        default server
> www.kcmultiservice.com
> (/usr/apache/conf/httpd.conf:1000)
>                        port 80 namevhost
> www.kcmultiservice.com
> (/usr/apache/conf/httpd.conf:1000)
>                        port 80 namevhost
> kcmultiservice.com (/usr/apache/conf/httpd.conf:1008)
>                        port 80 namevhost
> www.bluekc.com (/usr/apache/conf/httpd.conf:1018)
>                        port 80 namevhost
> www.albertopujols.com
> (/usr/apache/conf/httpd.conf:1026)
> wildcard NameVirtualHosts and _default_ servers:
> _default_:*            192.168.2.50
> (/usr/apache/conf/httpd.conf:993)
> 
> ************
> I guess this looks good.
> 
> When I try to reach www.albertopujols.com, or
> www.bluekc.com, or even by typing the external IP from
> outside I get the content of www.kcmultiservices.com.
> This is not the default. I don't know why I can't get
> to the other pages. 
> 
> 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 don't know what to do, I am getting frustrated with
> this. Please help. Apologies for the long post.
> 
> Thanks in advance for your help.
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo
> http://search.yahoo.com
> 
> 
> majordomo at kclug.org
> 




More information about the Kclug mailing list