Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

Post by Stephen Hurrel » Tue, 11 Nov 1997 04:00:00



Hello.

Have been running 1.2b8 for a intranet and decided to move upto 1.3b2. I
have several name based virtual hosts that have been working under
1.2b8. After compiling and installing 1.3b2 my virtual hosts do not
work. In fact what happens is that even though DocumentRoot and default
server name is different, eg: www.serverA.net pointing to /www/default,
Apache 1.3b2 will always take me to the first defined virtual host as if
it's locked to it no matter what virtual host I try to browse. What
gives? Please post and E-Mail.

In /etc/hosts for my machines IP address I have

A.B.C.D         www.default.net www.virtA.net www.virtB.net

In ../conf/httpd.conf I have;

<VirtualHost www.virtA.net>

DocumentRoot /usr/local/www/virtA
ServerName www.virtA.net
ErrorLog logs/virtA.error.log
TransferLog logs/virtA.access.log
</VirtualHost>

<VirtualHost www.virtB.net>

DocumentRoot /usr/local/www/virtB
ServerName www.virtB.net
ErrorLog logs/virtB.error.log
TransferLog logs/virtB.access.log
</VirtualHost>

--

 
 
 

Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

Post by Marc Slemk » Tue, 11 Nov 1997 04:00:00



Quote:>Hello.
>Have been running 1.2b8 for a intranet and decided to move upto 1.3b2. I
>have several name based virtual hosts that have been working under
>1.2b8. After compiling and installing 1.3b2 my virtual hosts do not
>work. In fact what happens is that even though DocumentRoot and default
>server name is different, eg: www.serverA.net pointing to /www/default,
>Apache 1.3b2 will always take me to the first defined virtual host as if
>it's locked to it no matter what virtual host I try to browse. What
>gives? Please post and E-Mail.

Did you read the CHANGES file and
http://www.apache.org/docs/misc/known_bugs.html regarding the
NameVirtualHost directive?

Oh, and it is always a lot easier too debug vhost problems if
you give the real names.

 
 
 

Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

Post by Stephen Hurrel » Thu, 13 Nov 1997 04:00:00


FYI: Here was what I was missing...

In the document:
        http://www.apache.org/docs/vhosts/examples.html#name
Is the statement:
Apart from localhost there are no unspecified addresses/ports, therefore
the main server only serves localhost requests. Due to the fact that
www.domain.tld has the highest priority it can be seen as the default or
primary server.

It is clear now. The http.conf file (sans VirtualHost directives) is for
localhost. If I add a www.virtA.net to the hosts file I must add a
VirtualHost entry for it. The first VirtualHost entry will be the
default server. It this correct?

--

Contract me for analysis & programming services.
MS NT/W95/Office/VB  GNU/Linux  HTML/Java/C(++)  RDBMS:PG95/Informix

 
 
 

1. : How to prevent one named virtual host from "seeing" another virtual hosts files ?

I have a question about named virtual hosts.  I have the following
config (with IPs changed):

Aapche server IP 192.168.1.1

Named virtual host - host1.mydomain.com
Docroot = /usr/local/apache/htdocs-host1

Named virtual host - host2.mydomain.com
Docroot = /usr/local/apache/htdocs-host2

I want SSL enabled on the host1.mydomain.com but NOT on htdocs-host2.

I've setup what I thought was going to work and it does almost.
Normal non-SSL access works fine.  Its the SSL part that is messed up.
If I access https://host2.mydomain.com, I get the index.html page for
host1.mydomain.com.  This has to be related to how the VirtualHost
container is setup for host1.mydomain.com.

Can someone help me out?  How do I prevent host2 from being
accessed by HTTPS completely, if possible ?  Is there a named virtual
host configuration that allows some hosts to have both 80 and 443
access and other to only have 80 and maybe again other to only have
443?

The following are the options that I think are important in the
httpd.conf file:

#
# Virtual Host host1.mydomain.com
# DocumentRoot, ErrorLog, CustomLog, and all that should be taken
# from the already defined values from the httpd.conf - I think
#
<VirtualHost 192.168.1.180>
    ServerName host1.mydomain.com
</VirtualHost>

#
# Virtual Host host2.mydomain.com
#
<VirtualHost 192.168.1.1:80>
    ServerName host2.mydomain.com

    DocumentRoot /usr/local/apache/htdocs-host2
    ErrorLog /usr/local/apache/logs/host2-error_log
    CustomLog /usr/local/apache/logs/host2-access_log combined
</VirtualHost>

<IfDefine SSL>

<VirtualHost 192.168.1.1:443>

#  General setup for the virtual host
ServerName host1.mydomain.com

DocumentRoot /usr/local/apache/host1-secure-htdocs
ErrorLog /usr/local/apache/logs/host1-ssl_error_log
TransferLog /usr/local/apache/logs/host1-ssl_access_log

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#### And all that jazz

</VirtualHost>

2. Fax Servers for Linux?

3. Mixing Apache Name Based Virtual Hosts and SSL Virtual Host

4. Non-Essential, Essential Applications ........

5. Virtual Host defaults to first host

6. ifconfig: excessive frame errors

7. Apache 2.0.x virtual host ALWAYS beings up the FIRST host in the list..

8. how to run a script??

9. FrontPage virtual hosting, removal or reset of virtual host

10. For Discussion: web virtual hosting vs mail virtual hosting

11. Apache not serving virtual hosts on the first try

12. Appropriate HTTP Error Code for "No Default Host" in Name-Based Virtual Host Setup

13. Apache - Virtual Host or /etc/hosts