You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by mi...@casa.co.cu on 2010/02/23 03:26:41 UTC

[users@httpd] Virtual Directory -- Virtual Hosts Logs

Hello

I have a small problem with my apache server.

I work with CentOS 5.4 with httpd-2.2.3-31

I have multiple virtual directories and several VirtualHosts. Each  
VirtualHost has on the "CustomLog" so that will generate a log for  
each virtualhost.

My problem is when trying to access any virtual directory under the  
name of my server. example: http://centos.home.cu/stats save the  
access log in the logs of the first VirtualHost I declared.
should not be stored in access_log?

who i can fix this?

If you disable the first virtualhost then the same with the second  
that follows.

This is my settings on the Logs and VirtualHost:

ErrorLog logs/error_log
LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"  
\"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog logs/access_log combined

<VirtualHost *:80>
         DocumentRoot /var/www/html/site/
         ServerName www.home.cu
         ServerAlias www.home.com
         ServerAdmin webmaster@home.cu
          CustomLog /var/log/httpd/site.log combined
   <Directory "/var/www/html/site/">
      AllowOverride None
      Options FollowSymLinks MultiViews
      Order Allow,Deny
      Allow from all
   </Directory>
</VirtualHost>


Thanks

----------------------------------------------
Webmail, servicio de correo electronico
Casa de las Americas - La Habana, Cuba.



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


Re: [users@httpd] Virtual Directory -- Virtual Hosts Logs

Posted by Michel Bulgado <mi...@casa.co.cu>.
Tom Evans wrote:
> On Tue, Feb 23, 2010 at 2:26 AM,  <mi...@casa.co.cu> wrote:
>   
>> Hello
>>
>> I have a small problem with my apache server.
>>
>> I work with CentOS 5.4 with httpd-2.2.3-31
>>
>> I have multiple virtual directories and several VirtualHosts. Each
>> VirtualHost has on the "CustomLog" so that will generate a log for each
>> virtualhost.
>>
>> My problem is when trying to access any virtual directory under the name of
>> my server. example: http://centos.home.cu/stats save the access log in the
>> logs of the first VirtualHost I declared.
>> should not be stored in access_log?
>>
>> who i can fix this?
>>
>> If you disable the first virtualhost then the same with the second that
>> follows.
>>
>>     
>
> The first vhost is special; it is the default vhost, and any request
> for a host that does not match one of the other specified vhosts will
> be served by the first vhost.
>
> Therefore, the correct thing to do is to insert a dummy default vhost
> into your configuration, without a CustomLog. Then requests for
> default vhosts will be logged to the default access log.
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> 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
>
>   
Hello

I have added dummy vhost default in my configuration and works 
perfectly, every access made to the virtual directories is stored in 
access_log.

Thanks for the help

Michel

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


Re: [users@httpd] Virtual Directory -- Virtual Hosts Logs

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Feb 23, 2010 at 2:26 AM,  <mi...@casa.co.cu> wrote:
> Hello
>
> I have a small problem with my apache server.
>
> I work with CentOS 5.4 with httpd-2.2.3-31
>
> I have multiple virtual directories and several VirtualHosts. Each
> VirtualHost has on the "CustomLog" so that will generate a log for each
> virtualhost.
>
> My problem is when trying to access any virtual directory under the name of
> my server. example: http://centos.home.cu/stats save the access log in the
> logs of the first VirtualHost I declared.
> should not be stored in access_log?
>
> who i can fix this?
>
> If you disable the first virtualhost then the same with the second that
> follows.
>

The first vhost is special; it is the default vhost, and any request
for a host that does not match one of the other specified vhosts will
be served by the first vhost.

Therefore, the correct thing to do is to insert a dummy default vhost
into your configuration, without a CustomLog. Then requests for
default vhosts will be logged to the default access log.

Cheers

Tom

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