httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Van Crombrugge <mark.vancrombru...@vliz.be>
Subject [users@httpd] Apache2 only serves first virtualhost
Date Thu, 29 Jan 2009 17:09:00 GMT
I moved some websites from an Apache1 to an Apache2 server which was  
allready hosting one site (defined by a colleague some months ago).
Added the second site to the httpd.conf file but the first one is  
allways served, even when typing the URL of the second one.

If you change the position of the sites in the httpd.conf, it is  
obvious that it is allways the first site who is served.

Must have defined about 40-50 websites on a multitude of servers and  
never had this problem.

I can not ask my colleague what he changed in the original config file  
because he is on sick leave for many months to come.

I joined three versions of the config files and the output of 'httpd - 
S' : any hint that can make me see the light and get this to work will  
make my week!

Also replaced "*.80" with "<ipaddress>:80" and just "<ipaddress>",  
same result.
If I copy this to an Apache1 server, it works...

Thanks in advance for helping a frustrated IT dude.

Mark


CHECKED FIRST HTTPD.CONF  WITH HTTPD -S:

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:8443         server1.test.org (/etc/httpd/conf.d/nss.conf:73)
_default_:443          server1.test.org (/etc/httpd/conf.d/ssl.conf:81)
*:80                   is a NameVirtualHost
          default server www.website1.org (/etc/httpd/conf/httpd.conf: 
1050)
          port 80 namevhost www.website1.org (/etc/httpd/conf/ 
httpd.conf:1050)
          port 80 namevhost www.website2.org (/etc/httpd/conf/ 
httpd.conf:1075)
          port 80 namevhost www.website3.org (/etc/httpd/conf/ 
httpd.conf:1088)
Syntax OK

-----------------
FIRST HTTPD.CONF, no mather which URL one browses for, "First Website"  
is allways served.

NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.

# First Website
<Virtualhost *:80>
   Documentroot /var/www/html/www.website1.org
   ServerName www.website1.org
   ServerAlias website1.org
</Virtualhost>

#Second Website
<Virtualhost *:80>
   Documentroot /var/www/html/website2
   ServerName www.website2.org
   ServerAlias website2.org
</Virtualhost>
----------------


Second HTTPD.CONF, no mather which URL one browses for, "Second  
Website" is allways served.

NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.

#Second Website
<Virtualhost *:80>
   Documentroot /var/www/html/website2
   ServerName www.website2.org
   ServerAlias website2.org
</Virtualhost>

# First Website
<Virtualhost *:80>
   Documentroot /var/www/html/www.website1.org
   ServerName www.website1.org
   ServerAlias website1.org
</Virtualhost>
----------------

Third HTTPD.CONF, no mather which URL one browses for, "Third Website"  
is allways served.

NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.

#Third Website
<Virtualhost *:80>
   Documentroot /var/www/html/website3
   ServerName www.website3.org
   ServerAlias website3.org
</Virtualhost>

#Second Website
<Virtualhost *:80>
   Documentroot /var/www/html/website2
   ServerName www.website2.org
   ServerAlias website2.org
</Virtualhost>

# First Website
<Virtualhost *:80>
   Documentroot /var/www/html/www.website1.org
   ServerName www.website1.org
   ServerAlias website1.org
</Virtualhost>
----------------








---------------------------------------------------------------------
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