Control Web Panel
WebPanel => How to => Topic started by: bullten on August 30, 2018, 11:10:08 AM
-
Below is tutorial to install and access awstats in cwp
https://panel.bullten.net/knowledgebase/71/Adding-and-integrating-Awstats-in-CWP--Centos-6or7.html
-
I use this tutorial, but stats wont update.
Last update: never update, shows on top of page.
-
You need to add cronjob as mentioned in tutorial.
-
Yes i used this: crontab -l | { cat; echo "* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=cwp"; } | crontab -
-
what did you choose domain when you were installing awstats?
what is output of crontab -l
-
31 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh/cwp_certs" > / dev/null
05 01 * * * /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admi n/include/alertandautorenewssl.php
* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=cwp
* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=cwp
* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=cwp
* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=cwp
I do all step from tutorial copy paste..
Did i need to change "cwp" with my domain(www.domain.com)
-
yes you need to change with the domain name you choose while installing awstats
-
I use command perl tools/awstats_configure.pl again and add domain on line Your web site, virtual server or profile name: www.domain.com
But i still dont have updates.
-
what is output of
ls -lah /etc/awstats/
-
total 140K
drwxr-xr-x 2 root root 66 Aug 31 15:51 .
drwxr-xr-x. 89 root root 8.0K Aug 30 16:36 ..
-rw-r--r-- 1 root root 63K Aug 31 11:38 awstats.cwp.conf
-rw-r--r-- 1 root root 63K Aug 31 15:51 awstats.www.salespc.net.conf
-
What is output of
cat /etc/awstats/awstats.www.salespc.net.conf | grep LogFile
-
# "LogFile" contains the web, ftp or mail server log file to analyze.
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
LogFile="/var/log/httpd/mylog.log"
PurgeLogFile=0
# When PurgeLogFile is setup to 1, AWStats will clean your log file after
# This parameter is not used if PurgeLogFile=0
# Possible values: 0, 1, or tags (See LogFile parameter) for suffix
-
Run the commands below
sed -i 's|var/\log/\httpd/\mylog.log|usr\/local/apache/logs/access_log|g' /etc/awstats/awstats.www.salespc.net.conf
rm -rf /usr/local/apache/logs/access_log
service httpd restart
crontab -l | { cat; echo "* * * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.salespc.net"; } | crontab -
-
Its same when open http://localip/awstats/awstats.pl?month=04&year=2018&output=main&config=www.salespc.net&framename=index
No updates
-
Well then what is output of
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.salespc.net
-
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).
-
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
-
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
-
output of
tail -f /usr/local/apache/logs/access_log
-
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
-
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
-
Then cant work with ngix?Chance to work it or some alternative?
-
I dont know if actually it is causing issue. I would suggest you to contact your server admin regarding it once.
-
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
-
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
-
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
-
there is not that line in this file?
Did i need to add it?
-
add the below command at the end of your httpd.conf file
CustomLog "logs/access_log" combined
-
WORK!
Where was the problem actualy?
And 10x for you time and help.
-
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.
-
I used this tutorial but I faced with a text plain output when try to see stats
beginning like this:
#!/usr/bin/perl
#------------------------------------------------------------------------------
# Free realtime web server logfile analyzer to show advanced web statistics.
# Works from command line or as a CGI. You must use this script as often as
# necessary from your scheduler to update your statistics and from command
# line or a browser to read report results.
# See AWStats documentation (in docs/ directory) for all setup instructions.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
require 5.007;
#$|=1;
#use warnings; # Must be used in test mode only. This reduce a little process speed
#use diagnostics; # Must be used in test mode only. This reduce a lot of process speed
use strict;
no strict "refs";
use Time::Local
; # use Time::Local 'timelocal_nocheck' is faster but not supported by all Time::Local modules
use Socket;
use Encode;
use File::Spec;
-
Hola,
Te sale esa pantalla porque tienes que agregar el modulo al archivo de configuracion. en la ruta:
/usr/local/apache/conf.d/mod_cgid.conf
Agregas
LoadModule cgid_module modules/mod_cgid.so
<IfModule cgid_module>
<Directory /usr/local/awstats/wwwroot/cgi-bin/>
Options ExecCGI SymLinksifOwnerMatch
SetHandler cgi-script
AddHandler cgi-script .cgi .pl .py
Require all granted
AllowOverride All
</Directory>
</IfModule>
reinicias apache
Con eso deberia de abrir la interfaz.
Ahora tendras inconvenientes en actualizar las estadisticas. En si tendras que crear un directorio con permiso de lectura y escritura en la ruta donde este el usuario de dicho dominio que usara la metrica.
Ejemplo.
/home/alca/awstats
Dicho directorios con los permisos necesarios, sera utilizado para dejar el reporte de estadisticas, pero primero deberas editar
el archivo de configuracion de dicho sitio en la ruta:
/etc/awstats
ahi nano al archivo de configuracion de tu sitio. y buscas las lineas.
AllowToUpdateStatsFromBrowse de 0 le pones un 1, asi puedes actualizar desde el boton desde la interfaz.
Buscas en el mismo archivo la linea Dirdata y la editas con la nueva ruta de, por ejemplo:
#DirData="/var/lib/awstats"
DirData="/home/alca/awstats" "Yo lo tengo en esa ruta , pero deberia ser por default, en la ruta que tu deseeas el directorio debe tener los permisos de escritura y lectura"
Con eso ya deberias poder tener la estadisticas actualizada.
Saludos
-
Hi,
I received this error:
[root@p01 lib]# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=cwp
Error: Not same number of records of RobotsSearchIDOrder_listx (total is 1106 entries) and RobotsHashIDLib (1105 entries without 'unknown') in Robots database. Check your file /usr/local/awstats/wwwroot/cgi-bin/lib/robots.pm is up to date.
Setup ('/etc/awstats/awstats.cwp.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
Can someone help me?
-
Hello,
Please follow the link below
https://panel.bullten.net/knowledgebase/59/Install-and-Configure-Awstats-in-CWP.html
-
Hi,
Thank you!! with this tutorial worked.
-
Hi,
Thank you!! with this tutorial worked.
What tutorial did you use?
-
This tutorial
https://panel.bullten.net/knowledgebase/59/Install-and-Configure-Awstats-in-CWP.html
-
Nice sure going to try it out tomorrow :)
-
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):
104.231.41.24 - - [01/Mar/2019:11:23:27 +0100] "POST / HTTP/1.0" 204 -
Setup ('/etc/awstats/awstats.tt.com.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
I end up whit this error when i follow that guide.