De Babel Digital


cd /opt
tar xf awstats-7.0.tar.gz
mv awstats-7.0 awstats
cd awstats/tools/

# perl

----- AWStats awstats_configure 1.0 (build 1.9) (c) Laurent Destailleur ----- This tool will help you to configure AWStats to analyze statistics for one web server. You can try to use it to let it do all that is possible in AWStats setup, however following the step by step manual setup documentation (docs/index.html) is often a better idea. Above all if: - You are not an administrator user, - You want to analyze downloaded log files without web server, - You want to analyze mail or ftp log files instead of web log files, - You need to analyze load balanced servers log files, - You want to 'understand' all possible ways to use AWStats... Read the AWStats documentation (docs/index.html).
-----> Running OS detected: Linux, BSD or Unix Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'. If you want to use standard directory, you should first move all content of AWStats distribution from current directory: /opt/awstats to standard directory: /usr/local/awstats And then, run from this location. Do you want to continue setup from this NON standard directory [yN] ? Y
-----> Check for web server install
Enter full config file path of your Web server. Example: /etc/httpd/httpd.conf Example: /usr/local/apache2/conf/httpd.conf Example: c:\Program files\apache group\apache\conf\httpd.conf Config file path ('none' to skip web server setup): > none
Your web server config file(s) could not be found. You will need to setup your web server manually to declare AWStats script as a CGI, if you want to build reports dynamically. See AWStats setup documentation (file docs/index.html)
-----> Update model config file '/opt/awstats/wwwroot/cgi-bin/awstats.model.conf' File awstats.model.conf updated.
-----> Need to create a new config file ? Do you want me to build a new AWStats config/profile file (required if first install) [y/N] ? Y
-----> Define config file name to create What is the name of your web site or profile analysis ? Example: Example: demo Your web site, virtual server or profile name: >
-----> Define config file path In which directory do you plan to store your config file(s) ? Default: /etc/awstats Directory path to store config file(s) (Enter for default): >
-----> Create config file '/etc/awstats/' Config file /etc/awstats/ created.
-----> Add update process inside a scheduler Sorry, does not support automatic add to cron yet. You can do it manually by adding the following command to your cron: /opt/awstats/wwwroot/cgi-bin/ -update Or if you have several config files and prefer having only one command: /opt/awstats/tools/ now

A SIMPLE config file has been created: /etc/awstats/ You should have a look inside to check and change manually main parameters. You can then manually update your statistics for '' with command: > perl -update You can also build static report pages for '' with command: > perl -output=pagetype

Vamos criar diretório data e dar permissão a outros usuários:

mkdir data
chmod 755 data

Veja onde seus logs seja do nginx ou apache. Separe na conf de cada site um log pra cada site e acesso,

ls /var/log/nginx/
access.log		     localhost.access.log	      redrecicladores.access.log
democraciaweb.access.log     mcdcorretora.access.log	      rls.access.log
error.log		     mncr.access.log		      solidariedadeacuba.access.log
fabricadetv.access.log	     mocambos.access.log	      teiaculturaviva.access.log
girassolacg.access.log	     mocambos.access.log.2	      tvlan.access.log
hospedagemplone.access.log   mulhereslivres.access.log	      vazquezppg.access.log
linguagemdigital.access.log  noisnarua.access.log

Vamos usar log da
Criar arquivo com base no /opt/awstats/wwwroot/cgi-bin/awstats.model.conf

nano /etc/awstats/

Pra criar outras conf

cp /opt/awstats/wwwroot/cgi-bin/awstats.model.conf /etc/awstats/awstats.www.dominio.tdl.conf 

Criar diretorio pra paginas html

mkdir -p /opt/awstats/data/dominio.tdl/visitas/

Editar linha 153


Editar linha 203


Configuração dentro do nginx
www.dominio.tdl/visitas - abaixo do dominio. (tarefa separar cada dominio em .conf propria)

       location ~ ^/visitas {
               root   /opt/awstats/data/domino.tdl;
               index  awstats.www.domino.tdl index.html;
location ~ ^/icon/ { root /opt/awstats/wwwroot; index index.html; }

Ai deixar no cron pra de tempo em tempo gerar o html

/opt/awstats/tools/ -config=www.domino.tdl -update -awstatsprog=/opt/awstats/wwwroot/cgi-bin/ -dir=/opt/awstats/data/domino.tdl/visitas > /dev/null