LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   General (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=25)
-   -   H-Sphere traffic_log not updating (http://www.litespeedtech.com/support/forum/showthread.php?t=6295)

bobykus 10-03-2012 04:16 AM

H-Sphere traffic_log not updating
 
There are visible requests in access log configured via vhost but no traffic
related to web site in H-Sphere traffic_log log

0.4.6.3 - - [03/Oct/2012:13:10:52 +0200] "GET /site/wp-admin/post.php?post=135&action=edit&message=1 HTTP/1.1" 200 21944 "http://...nhagen.dk/site/wp-admin/post.php?post=135&action=edit&message=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20100101 Firefox/15.0.1"
0.4.6.3 - - [03/Oct/2012:13:10:56 +0200] "GET /site/wp-admin/admin-ajax.php?action=oembed-cache&post=135 HTTP/1.1" 200 21 "http://...nhagen.dk/site/wp-admin/post.php?post=135&action=edit&message=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20100101 Firefox/15.0.1"

# tail -f traffic_log
1349259007 2.7.2.6 36 177
1349259007 2.7.2.6 30 177
1349259009 2.7.2.6 38 712
1349259020 2.7.2.6 469 203


Only main IP of web server is there. Should I do some magic passes to let
mod_psoft_traffic collect the stats right?

bobykus 01-09-2013 11:37 PM

We use H-Sphere apache configs with litespeed
Logging section looks like


<IfModule log_config_module>
LogFormat "&#37;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

BufferedLogs On

CustomLog /hsphere/local/var/httpd/logs/access_log combined

# Custom Psoft directive to provide logging into traffic_log file
# for VH with redefined CustomLog. Do not change its status!
AlwaysServerLogs on

<IfModule logio_module>
LogFormat "%{%s}t %v %I %O" combinedio
CustomLog /hsphere/local/var/httpd/logs/traffic_log combinedio
</IfModule>
</IfModule>

However the only records I can see is the ones with IP addresses, instead of host names.
Like this

# tail -f traffic_log
1349259007 2.7.2.6 36 177
1349259007 2.7.2.6 30 177
1349259009 2.7.2.6 38 712
1349259020 2.7.2.6 469 203


If I delete log setting records from httpd.conf and set it is litespeed admin like


File Name /hsphere/local/var/httpd/logs/traffic_log
Piped Logger Not Set
Log Format %{%s}t %v %I %O
Log Headers Referrer UserAgent Host None
Rolling Size (bytes) 100M
Keep Days 1
Compress Archive Yes

I have no logs at all.
We are on 2CPU Enterprise license.

NiteWave 01-09-2013 11:51 PM

got this link:
http://www.psoft.net/HSdocumentation...ilt-in_traffic
so the 2nd field should be domain name instead of IP address, do you know where and what the log format is defined ?

bobykus 01-10-2013 01:14 AM

Log and log format is defined in in

/hsphere/shared/apache2/conf/httpd.conf

Litespeed is configured

Using Apache Configuration
Load Apache Configuration Yes
Auto Reload On Changes No

Apache Binary Path /hsphere/shared/apache2/bin/httpd.worker
Apache Configuration File /hsphere/local/config/httpd2/httpd.conf


I can PM you /hsphere/shared/apache2/conf/httpd.conf

NiteWave 01-10-2013 02:14 AM

for a quick test, how about change
Quote:

Log Format %{%s}t %v %I %O
to
Log Format %{%s}t %{Host}i %I %O

bobykus 01-10-2013 02:38 AM

OK, now I see, the problem is instead of loggin all to /hsphere/shared/apache/logs/traffic_log it write only entries for web sites
which have no TransferLog enabled in virtual host config.
But, all I need is to have a separate log files for virtual hosts and one traffic_log for all to collect traffic statistic. Instead of having records in user logs OR in traffic_log.
As for

LogFormat "%{%s}t %{Host}i %I %O" combinedio


it looks fine now. It write http_host value. But I need

%v The canonical ServerName of the server serving the request.

which is slightly different.

NiteWave 01-10-2013 06:44 PM

Quote:

%v The canonical ServerName of the server serving the request.

which is slightly different.
agree. you may have to put
CustomLog /hsphere/local/var/httpd/logs/traffic_log combinedio
in every virtual host's configuration.

bobykus 01-11-2013 12:34 AM

O_o ????
wonder why it works in apache and dont in litespeed.
is there any right solution but modify user vhosts?

NiteWave 01-11-2013 04:22 AM

&#37;%%
I did some tests for"%v" under pure apache, it acts like litespeed: virtualhost's server name not showing there --- since my test env not good today, it may be wrong. it's best you can work out a test case which I can reproduce it.

according http://www.psoft.net/HSdocumentation...ilt-in_traffic
Quote:

Since version 2.5, H-Sphere introduces the mod_psoft_traffic module to write a more informative and convenient traffic log into the /hsphere/local/var/httpd/logs/traffic_log file. Traffic log has the following format:

<unix_timestamp> <domain_name> <incoming_traffic> <outgoing_traffic>
my conclusion so far, without this H-Sphere specific module mod_psoft_traffic, %v won't be able to convert to virtual host's server name in server level section of httpd.conf.

if so, there may be no other better way than every virtual host to include "CustomLog /hsphere/local/var/httpd/logs/traffic_log combinedio" to mimic this H-Sphere's behavior.

bobykus 01-11-2013 04:38 AM

Dear Nite,

Looks like you suggestion about put log to vhosts works.
So I'll try it on live servers, if there will be no issues in regards to
performance etc it could be the workaround! I'll let ya know Monday.
Thank you for your efforts!


All times are GMT -7. The time now is 12:13 AM.