problems with virtual hosts

problems with virtual hosts

Post by Francis Mouthau » Fri, 19 Sep 1997 04:00:00



Hi,

I have a problem with apache 1.2.4.

When I use my httpd.conf (which has about 20 web servers) with apache
1.2beta8 it works fine, but NOT on 1.2.4.

I checked the file serveral times, re-started with a new one... but it's
useless... Apache (1.2.4) just becomes crazy and shows me always the SAME
server!

But when I put IP addresses in the <VirtualHost> line the server works,
but not the one after him (or I have to do the same). If I give all
servers IP addresses instead of names (which are valid) I have SOME of
them working, but it is not stable.

Well... I really wonder about config files parsing...

Francis

PS: CC me a copy of your reply, thanks.


|      Ingenieur  / http://www.freenet.fr/bluepatch     |
:  Office: 33 01-64-52-64-64  /  Fax: 33 01-64-09-54-71 :

 
 
 

problems with virtual hosts

Post by jim barch » Sun, 21 Sep 1997 04:00:00


Hello Francis!

Quote:>I have a problem with apache 1.2.4.

Yah, me too, 'same but different' problem. :) I was -just- about to
post my configs to this group when I saw your post.

Quote:>When I use my httpd.conf (which has about 20 web servers) with apache
>1.2beta8 it works fine, but NOT on 1.2.4.

I was also just about to try falling back to that version, but didn't
have to, read on.

Quote:>I checked the file serveral times, re-started with a new one... but it's
>useless... Apache (1.2.4) just becomes crazy and shows me always the SAME
>server!

I am using only two domains. Totally 'non-ip' setup, -can't- even play
with IP numbers. I was not having the 'always the same' problem which
I've seen mentioned in Dejanews (but not solved), but the symptom was
that -one- domain worked (the second  one) and the first domain always
fell back to the default ~/httpd/html/. The first domain did -not-
fall through to the second VirtualHost.

Should also mention that technically it's three names. One is a third
level machine name by which my ISP knows me, the other two are second
level Internic registered names.

So Mike Creswick emails me and suggested that I swap the domains in
httpd.conf to make sure it wasn't defaulting to the 'last' one. I was
pretty sure that wasn't it but had a very interesting effect anyway.
Suddenly -both- domains -do- work! Holy canolis Batman! Gofigger!!

Quote:>But when I put IP addresses in the <VirtualHost> line the server works,
>but not the one after him (or I have to do the same). If I give all
>servers IP addresses instead of names (which are valid) I have SOME of
>them working, but it is not stable.

>Well... I really wonder about config files parsing...

Nothing more 'indebuggable' (is that a word? [G]) than symptoms with
no obvious patterns. :)

But since I'm using only two domains, and the only thing I did to make
it work was swap them, I do see one possible difference. The
non-working version had the domain names 'out of alphabetical
sequence'; www.ccc.com followed by www.aaa.com. Swapped them to alpha
sequence and it works.

So, what I'd like you to try is rearranging the sequence to follow
alphabetically.

Given that mine went from nonworking to working with only that one
change I'd bet even odds that it fixes yours.

If it doesn't work I'd also try using and rearranging by sorted IPs.

And if either/both of those do work then it does mean that something
is definitely not right in the config parsing, and certainly narrows
down where to look for the error.

But just for giggles, here's a snippet of httpd.conf:

Quote:><VirtualHost www.tfabbs.org>
>ServerName www.tfabbs.org
>DocumentRoot /home/httpd/tfabbs
>ServerPath /tfabbs
></VirtualHost>

Should also mention that I have symlinks pointing from
~/httpd/html/tfabbs to DocumentRoot. It was that plus ServerPath that
definitely made the one viable domain start working. Will be removing
them to see how it behaves.

Have a :) day!

--
jim barchuk

http://www.10mb.com/jbarchuk/
http://www.thesurvey.com

 
 
 

1. Problems whith virtual host

Hi, my apache server is 1.3.1
        I try to use Name-based Virtual Hosts , we have a server
server.domain1.com which has 2 alias (CNAME) www.domain1.com and
www.domain2.com.
        I read the doc "Virtual Host examples for common setups " and try to
apply to my situation one IP address and 2 names.
------------------------
http.conf:
-----------
ServerName server.domain1.com

NameVirtualHost 1.2.3.4

<VirtualHost 1.2.3.4>
DocumentRoot /apache/www
ServerName www.domain1.com
</VirtualHost>

<VirtualHost 1.2.3.4>
DocumentRoot /apache/www/domain2
ServerName www.domain2.com
</VirtualHost>
-------------------------
I put nothing about virtual host in the srm.conf.

When i start apache, i have:
--------------
./apachectl start
VirtualHost configuration:
1.2.3.4:80      is a NameVirtualHost
                       default server www.domain1.com
 (/usr/local/apache_1.3.1/etc/httpd.conf:245)
                       port 80 namevhost www.domain1.com
(/usr/local/apache_1.3.1/etc/httpd.conf:245)
                       port 80 namevhost www.domain2.com
(/usr/local/apache_1.3.1/etc/httpd.conf:250)
./apachectl start: httpd started
------------------
So the namevirtualhost seems to work, everything is fine with the
domain1 but the domain2 has problems with the first page.

When i try with netscape 4 the url www.domain2.fr, i got the index.html
of the domain1 but not the images, because the images are search in the
documentroot of domain2.

When i try www.domain2.fr/index.html. everything is fine.

When i try with a client running on server.domain1.com everything is
fine.

????? any idea...

2. sed string interpreter

3. Problems with virtual hosts

4. Hard Disk Full

5. Problems with virtual host

6. Don't Change User ID under Redhat 6.1

7. problem accessing virtual host from windows xp

8. KDOrganizer

9. Problems with Virtual Hosts

10. apache problems with virtual hosts

11. Apache index problem with virtual host

12. Problem with virtual-hosting under linux

13. Problem with virtual host on apache and Digital Unix