Author Topic: [Tutorial] integrating Awstats in Centos Web Panel  (Read 50527 times)

0 Members and 2 Guests are viewing this topic.

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #15 on: August 31, 2018, 01:22:04 PM »
Create/Update database for config "/etc/awstats/awstats.www.salespc.net.conf" by AWStats version 7.7 (build 20180105)
From data in log file "/usr/local/apache/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /usr/local/apache/logs/access_log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is an example of records AWStats found in your log file (the record number 50 in your log):
192.168.3.4 - - [31/Aug/2018:16:13:03 +0300] "GET /awstatsicons/clock/hr11.png HTTP/1.0" 304 -
Setup ('/etc/awstats/awstats.www.salespc.net.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #16 on: August 31, 2018, 01:25:44 PM »
Its not working before of log format error. When you were installing awstats it must have asked you to fix log format. Did you checked no for it?

Also what is output of

cat /usr/local/apache/conf/httpd.conf | grep LogFormat

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #17 on: August 31, 2018, 01:26:50 PM »
I didnt remember.
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #18 on: August 31, 2018, 01:30:56 PM »
output of

tail -f /usr/local/apache/logs/access_log

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #19 on: August 31, 2018, 01:32:44 PM »
192.168.3.4 - - [31/Aug/2018:16:32:06 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:07 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:10 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:12 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:14 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:16 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:17 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:18 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:20 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:21 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324
192.168.3.4 - - [31/Aug/2018:16:32:23 +0300] "POST //xmlrpc.php HTTP/1.0" 503 21324


Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #20 on: August 31, 2018, 01:36:24 PM »
Well this is not absolutely correct output it needs. you are behind nginx and that may be causing issue.

rm -rf /usr/local/apache/logs/access_log
service httpd restart
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.salespc.net

If the above doesnt work. Temporarily disable nginx and run the above commands again and then check if it updates

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #21 on: August 31, 2018, 01:41:27 PM »
Then cant work with ngix?Chance to work it or some alternative?

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #22 on: August 31, 2018, 01:52:24 PM »
I dont know if actually it is causing issue. I would suggest you to contact your server admin regarding it once.

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #23 on: August 31, 2018, 01:54:26 PM »
last thing you can do is to check if your apache is using combined log format

cat /usr/local/apache/conf/httpd.conf | grep combined

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #24 on: August 31, 2018, 02:08:21 PM »
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    #CustomLog "logs/access_log" combined

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #25 on: August 31, 2018, 02:11:34 PM »
nano /usr/local/apache/conf/httpd.conf

find line

#CustomLog "logs/access_log" combined

Uncomment it and save it

run below commands again.

rm -rf /usr/local/apache/logs/access_log
service httpd restart
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.salespc.net

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #26 on: August 31, 2018, 02:16:30 PM »
there is not that line in this file?
Did i need to add it?

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #27 on: August 31, 2018, 02:18:04 PM »
add the below command at the end of your httpd.conf file

CustomLog "logs/access_log" combined

Offline
**
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #28 on: August 31, 2018, 02:21:17 PM »
WORK!
Where was the problem actualy?
And 10x for you time and help.

Offline
***
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #29 on: August 31, 2018, 02:23:40 PM »
Well when you install awstats it asks you to automatically fix combined logs but at that time you pressed N and it didnt do that. That was the issue.