httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject [users@httpd] virtual host problem
Date Fri, 23 Apr 2004 19:05:26 GMT
Versions: Apache 2.0.49/jk2.0.4

I have named virtual hosts set up and that is working ok. 

DocumentRoot /myroot
ErrorLog "| cronolog.exe /mylogs/main_error.log

NameVirtualHost 10.10.10.10:80
<VirtualHost 10.10.10.10:80>
    ServerName foo.bar.com:80
    ServerAdmin foobar@foobar.com
    DocumentRoot /foo/bar
    DirectoryIndex index.html
    CustomLog "| cronolog.exe /mylogs/foobar_access.log" combined
    ErrorLog "| cronolog.exe /mylogs/foobar_error.log
      
    <Directory /foo/bar>
        Options -Indexes -FollowSymLinks
        AllowOverride None
    </Directory>
</VirtualHost>


However I have no virtual host set up when a host name is not
provided(http://10.10.10.10). But somehow the error of 'directory index
denied for /' gets logged to the foobar_error.log instead of the main error
log. However the request is not logged to foobar_access.log. 

One more thing is that I am using mod_jk2 and requests to the domain name
for *.html are sent to tomcat. However it is not doing that for the
ipaddress request because I have not defined 10.10.10.10/*.html in the
workers2.properties. I understand and expect this jk2 behavior. 
However, if I place an index.html in /foo/bar then the request to
10.10.10.10 will pick it up instead of using the 'main' document root.

I think that I need a block like the following to redirect any other
requests to my virtual host: 

<VirtualHost 10.10.10.10:80>
	ServerName default:80
	#do whatever
</VirtualHost>

My real interest is in understanding what is going on here. I want to know
why this behavior is inconsistent as to when it uses the virtual host vs.
the main settings. My understanding was that a whole request(not just a
directive) either matches a <VirutalHost> or it uses the 'main' settings. Is
this a wrong assumption? 

thanks,
Charlie


Mime
View raw message