Virtual Directory -- Virtual Hosts Logs

Virtual Directory -- Virtual Hosts Logs

am 23.02.2010 03:26:41 von Michel

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


DocumentRoot /var/www/html/site/
ServerName www.home.cu
ServerAlias www.home.com
ServerAdmin webmaster@home.cu
CustomLog /var/log/httpd/site.log combined

AllowOverride None
Options FollowSymLinks MultiViews
Order Allow,Deny
Allow from all




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 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: Virtual Directory -- Virtual Hosts Logs

am 23.02.2010 11:02:59 von Tom Evans

On Tue, Feb 23, 2010 at 2:26 AM, 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 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: Virtual Directory -- Virtual Hosts Logs

am 23.02.2010 14:56:34 von Michel Bulgado

Tom Evans wrote:
> On Tue, Feb 23, 2010 at 2:26 AM, 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 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 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