[lug] Strange Apache VirtualHost behavior

David Morris lists at morris-clan.net
Mon Nov 22 11:01:22 MST 2004


I have several virtual hosts setup on my Apache web server
(1.3.26) and have just noticed a rather strange problem.

If I go to the following web address:

    http://david.morris-clan.net/foo/

I get a directory listing as expected.

If I go to this one:

    http://david.morris-clan.net/foo

(Note the lack of a trailing '/') I get redirected here:

    http://belsambar.morris-clan.net/foo/

Which, incidentally, happens to be the first virtual host
defined.  I've verified by re-ordering virtual hosts that it
always uses the first one defined.

Other than that, the virtual hosts all work as expected.

Anyone have an idea on what might cause this?

Here is the VirtualHost portion of my httpd.conf file (or a
relevant sample rather).

============================================================
NameVirtualHost 66.93.122.13

<VirtualHost 66.93.122.13:80>
	ServerAlias		morris-clan.net
	ServerAlias		*.morris-clan.net
	DocumentRoot 	/data/httpd/morris-clan.net
	Alias 			/pipermail/ /data/mailman/archives/public/
	Alias			/mailman-images/ /usr/doc/mailman/images/
    Alias           /viewcvs/ /usr/share/viewcvs/
    <Directory /data/httpd/morris-clan.net/html>
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

<VirtualHost 66.93.122.13:80>
	ServerAlias 	david.morris-clan.net
	ServerAlias 	*.david.morris-clan.net
	DocumentRoot 	/data/httpd/david.morris-clan.net/html/
	ErrorLog 		/var/log/apache/david.morris-clan.net-error.log
	TransferLog 	/var/log/apache/david.morris-clan.net-access.log
	ScriptAlias 	/cgi-bin/ /data/httpd/david.morris-clan.net/cgi-bin/
    <Directory /data/httpd/david.morris-clan.net>
        Options FollowSymLinks 
        AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>
============================================================

--David




More information about the LUG mailing list