[Resolved] Log configuration

DoM

Well-Known Member
#1
Hi,
i am using litespeed with cPanel.

On apache with cPanel i use customLog directive inside each virtualhost such as:

CustomLog "/usr/local/apache/logs/access_log" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""

In order to log each virtualhost entry with DOMAIN ITEM at start of line inside access_log

Litespeed does not seem to elaborate this directive so logs looklikes something:

x.x.x.x - - [24/Oct/2010:21:45:39 +0200] "GET /branche/?s=count&w=desc HTTP/1.0" 200 2601 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; link...)"

As you can see there is NO domain entry so i cannot determine which domain receive this request.

My goal is to log ALL domains request inside ONE access_log.


Waiting for your reply

Best regards
 
Last edited by a moderator:

NiteWave

Administrator
#2
my test on our cPanle box shows that litespeed support "%v" in LogFormat as well. please check if any other settings override it? I did test on 4.0.17
 

DoM

Well-Known Member
#3
Hi,
on litespeed configuration > server > log i tried both in log format:

"%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""

and

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

but no way.


When i was using apache instead of litespeed everything worked with following directives:

server access_log
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

CustomLog logs/access_log common

</IfModule>

and vhost access_log:
CustomLog /usr/local/apache/domlogs/$domain_name combined
CustomLog "/usr/local/apache/logs/access_log" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""


Do i need to add vhost template from litespeed instead of using httpd.conf ?


Waiting for your reply

Regards
 

NiteWave

Administrator
#4
when using litespeed with cPanel, litespeed will read and parse apache's httpd.conf. you needn't do settings at "litespeed configuration > server > log", just configure settings in /usr/local/apache/httpd.conf as if apache is running.
 

DoM

Well-Known Member
#5
Hi,
i did it from start but no way let it works.

My doubt is that litespeed read FIRST CustomLog and does not care about second inside vhost directives.

Waiting for your reply


Regards
 

DoM

Well-Known Member
#6
Inside litespeed > server > log my configuration is:

File name: $SERVER_ROOT/logs/access.log
Piped logger: empty
Log format: empty
Log headers: Referrer UserAgent Host
Rolling size: 2000M
Keep days: 365
Compress archive: yes
 

NiteWave

Administrator
#9
can you post your vhost setting in /usr/local/apache/conf/httpd.conf:
is it
CustomLog /usr/local/apache/domlogs/$domain_name combined
CustomLog "/usr/local/apache/logs/access_log" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
?

and for confirmation, what's your server's current setting:
Server-->General-->Using Apache Configuration File
Load Apache Configuration:
Auto Reload On Changes:
Apache Binary Path:
Apache Configuration File:
Apache Port Offset:
 

DoM

Well-Known Member
#10
Hi,
of course:

<VirtualHost x.x.x.x:80>
ServerName $domain
ServerAlias www.$domain
DocumentRoot /home/$user/public_html
ServerAdmin webmaster@$domain
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/$domain combined
CustomLog "/usr/local/apache/logs/access_log" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
CustomLog /usr/local/apache/domlogs/$domain-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User $user # Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled $user
<IfModule mod_suphp.c>
suPHP_UserGroup $user $user
</IfModule>
<IfModule !mod_disable_suexec.c>
SuexecUserGroup $user $user
</IfModule>
ScriptAlias /cgi-bin/ /home/$user/public_html/cgi-bin/


# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/$user/$domain/*.conf"

</VirtualHost>

and Server-->General-->Using Apache Configuration File

Load Apache Configuration: Yes
Auto Reload On Changes: Use Apache binary wrapper
Apache Binary Path: /usr/local/apache/bin/httpd
Apache Configuration File: /usr/local/apache/conf/httpd.conf
Apache Port Offset: 0


Waiting for your reply

Best regards
 
#11
confirmed that:
LogFormat "%v %h %l" myformat
CustomLog "/usr/local/apache/logs/test_log" myformat
works. but
CustomLog "/usr/local/apache/logs/test2_log" "%v %h %l"
not

this is a bug and fixed by developer. just updated in 4.0.17 release.
so now
CustomLog "/usr/local/apache/logs/test2_log" "%v %h %l"
working too
 
Last edited:
Top