httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif W" <warp-...@usa.net>
Subject Re: [users@httpd] Vhosts not ruted to the correct directory...
Date Sun, 02 May 2004 16:04:55 GMT
----- Original Message ----- 
From: "Peter Kjeldsen" <peterk@lingualizer.net>
To: <users@httpd.apache.org>
Sent: Sunday, May 02, 2004 4:04 AM
Subject: [users@httpd] Vhosts not ruted to the correct directory...


> Hi

Hello,

> My server runs mandrake 9,1 with apache 2.0.47 on a 2.6GHz celeron
> with 512 MB RAM. The server is connected via a Zoom X4 ADSL modem to
> 512/128 kbs line and the IP is a dynamic IP, which is updated/checked
> every 300 sec.
>
> The default web dir is: /var/www/html
> The content of this dir you can see if you go to
> http://www.lingualizer.net
>
> My problem is when I wanted to add a vitualhost to my server it still
> kept routing all request to the default site htt://www.lingualizer.net

Ok, so you have two sites?  One is using the server's main config, the
other is using a NBVH?  And when you try to get to the NBVH, you get the
page defined by the main server config?

> Both domains are in the DNS servers at ZoneEdit pointing to the same
IP
> so both domains show the same default content www.lingualizer.net and
> www.cotman-university.com
>
> I then created a dir called cotman-university.com
> at /var/www/html/cotman-university and copied a tmp index file into
it.
>
> Next I added the following to the file Vhosts.conf:
>
> Listen 80
> NameVirtualHost *
> <VirtualHost *>
> ServerName www.cotman-university.com
> DocumentRoot /var/www/html/cotman-university
> DirectoryIndex index.html
> </VirtualHost>

Not sure if this will help, but try being specific with your Listen
directive.  I think "Listen 80" implies "Listen *:80", and "Name
VirtualHost *" implies "NameVirtualHost *:80", but the two are currently
not the same, and not explicit, and I don't know if there's any
weirdness assosciated with that, but I use *:80 and have no problems, so
it's the first thing I'd try.  Also, don't you already have a "Listen
80" in your server's main config?  You should only use one Listen for
each port.  I don't know if Apache sticks to the first Listen, augments
the Listen list, or replaces the previous Listen.

Listen *:80
NameVirtualHost *:80

Also, try posting the <VirtualHost> configs.  You should have 2 of them.

> However, the two domains are still mixed up, that is pointing to the
> default /var/www/html...Why?

I NEVER use the default site as a real site if I start doing NBVH.  To
avoid these problems.  I leave the default site as is, and use the
correct NBVH Listen and NameVirtualHost directives to make Apache only
output NBVHs.  The trick is to make sure you have a catch-all dummy site
which is defined first.  I call mine simply "default", and what it does
mostly, is collect all hits that were not matched by any NBVH block.  In
my config, this is all IP addresses, and my ISP's name for my IP
address.  The purpose is to collect all IP scans and virus probes, and
put all the clutter and line noise into it's own log file.  Less mess to
sift through the REAL hit data.  My server's main configuration, I leave
with ServerName localhost.  Since I never go on the server and type lynx
http://localhost/ , my access log always has a size of 0, which
indicates that my NBVH setup is working properly.  Also note, I comment
out the Listen 80 in my main server config, so that it's only in my
vhost config area.

Leif

> And I have read the manual and I have tried the option in version 2.0
> so I am run dry for ideas. Any help is much appreciated!
>
> Kindest regards
> Peter
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message