httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <>
Subject RE: [users@httpd] virtual host problem
Date Mon, 26 Apr 2004 12:44:39 GMT
>Cox, Charlie wrote:
>> 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
>> <VirtualHost>>
>>     ServerName
>>     ServerAdmin
>>     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( But somehow the error of 'directory index
>> denied for /' gets logged to the foobar_error.log instead of the main
>> 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*.html in the
>> I understand and expect this jk2 behavior. 
>> However, if I place an index.html in /foo/bar then the request to
>> 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>>
>> 	ServerName default:80
>> 	#do whatever
>> </VirtualHost>>
>> My real interest is in understanding what is going on here. I want to
>> 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

>I can answer your log question.  Once you enable name based virtual 
>hosting (NBVH), if a request comes in matching the IP/port combo for the 
>NBVHs and a host header match is not found, the request will always 
>default to the first VH.

I just checked the other logs and it is not logging to any of my virtual
hosts. I just set up a log for the "main" server and it is not logged there
either. Any other ideas?

>Aaron W Morris <>> (decep)


View raw message