httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
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 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
>> 
>> 

>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 <aaronmorris@mindspring.com>> (decep)



 

Mime
View raw message