LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > H-Sphere traffic_log not updating

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2012, 04:16 AM
bobykus bobykus is offline
Senior Member
 
Join Date: Sep 2012
Posts: 64
Default 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?
Reply With Quote
  #2  
Old 01-09-2013, 11:37 PM
bobykus bobykus is offline
Senior Member
 
Join Date: Sep 2012
Posts: 64
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.

Last edited by bobykus; 01-10-2013 at 12:10 AM..
Reply With Quote
  #3  
Old 01-09-2013, 11:51 PM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
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 ?
Reply With Quote
  #4  
Old 01-10-2013, 01:14 AM
bobykus bobykus is offline
Senior Member
 
Join Date: Sep 2012
Posts: 64
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
Reply With Quote
  #5  
Old 01-10-2013, 02:14 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
for a quick test, how about change
Quote:
Log Format %{%s}t %v %I %O
to
Log Format %{%s}t %{Host}i %I %O
Reply With Quote
  #6  
Old 01-10-2013, 02:38 AM
bobykus bobykus is offline
Senior Member
 
Join Date: Sep 2012
Posts: 64
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.
Reply With Quote
  #7  
Old 01-10-2013, 06:44 PM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
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.
Reply With Quote
  #8  
Old 01-11-2013, 12:34 AM
bobykus bobykus is offline
Senior Member
 
Join Date: Sep 2012
Posts: 64
O_o ????
wonder why it works in apache and dont in litespeed.
is there any right solution but modify user vhosts?
Reply With Quote
  #9  
Old 01-11-2013, 04:22 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
&#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.

Last edited by NiteWave; 01-11-2013 at 04:29 AM..
Reply With Quote
  #10  
Old 01-11-2013, 04:38 AM
bobykus bobykus is offline
Senior Member
 
Join Date: Sep 2012
Posts: 64
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!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:59 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.