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

0 Members and 1 Guest are viewing this topic.

Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #30 on: December 23, 2018, 12:40:30 PM »
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;
 

Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #31 on: January 18, 2019, 05:22:03 AM »
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
« Last Edit: January 18, 2019, 05:28:31 AM by s0c25 »

Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #32 on: February 16, 2019, 12:47:18 AM »
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?

Offline
**

Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #34 on: February 22, 2019, 04:58:40 PM »
Hi,


Thank you!! with this tutorial worked.

Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #35 on: February 24, 2019, 01:48:48 PM »
Hi,


Thank you!! with this tutorial worked.

What tutorial did you use?


Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #37 on: February 28, 2019, 08:31:55 PM »
Nice sure going to try it out tomorrow :)

Offline
*
Re: [Tutorial] integrating Awstats in Centos Web Panel
« Reply #38 on: March 01, 2019, 10:26:57 AM »
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.