Wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz
Tar zxvf awstats-6.9.tar.gz
Music awstats-6.9 // usr/local/
CD/usr/local/awstats-6.9/tools/
./Awstats_configure.pl
Do you want to continue setup from this non standard directory [YN]?
Y
Config file path ('none' to skip Web Server SETUP ):
> None
File (required if first install) [Y/n]?
Y
Example: Demo
Your web site, virtual server or profile name:
> Test.openx.cn
-----> 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 ):
> Enter (by default, the configuration file is saved in/etc/AWStats)
Vim/etc/AWStats/awstats.test.openx.cn. conf
Replace the following Configuration:
Logfile = "/home/wwwlogs/Access _ % YYYY-24 % MM-24 % DD-24.log"
3. Start analysis and generate results
Finally, you can perform the analysis.
Run the following command:
/Usr/local/awstats-6.9/tools/wwwroot/cgi-bin/AWStats. pl-Update-Config = test.openx.cn
This command generates the result to the awstatsxxxx.www.xxxx.com.txt file in the/var/lib/AWStats directory.
Of course this looks inconvenient. You can use the following command to generate an HTML page, which is more intuitive.
/Usr/local/awstats-6.9/tools/awstats_buildstaticpages.pl-Update-Config = test.openx.cn-lang = cn-Dir =/data/AWStats-awstatsprog =/usr/local/awstats-6.9/wwwroot/cgi -bin/AWStats. PL
/Usr/local/awstats-6.9/tools/awstats_buildstaticpages.pl-update \
-Config = www.xxxxoke.com-lang = cn \
-Dir =/html/AWStats \
-Awstatsprog =/usr/local/awstats-6.9/tools/wwwroot/cgi-bin/AWStats. pl
This will generate a very intuitive analysis result page under the/html/AWStats directory.
Iv. Automation
It would be annoying to run several commands on the server every day. Thanks to crontab in the Linux World,
The following is a crontab from a netizen.
1 0 *** sh/home/ZYF/SH/cut_nginx_log.sh
0 1 ***/usr/local/awstats-6.9/wwwroot/cgi-bin/AWStats. pl-Update-Config = www.xxxxke.com
0 2 ***/usr/local/awstats-6.9/tools/awstats_buildstaticpages.pl-Update-Config = www.xxxxke.com-lang = cn-Dir =/html/AWStats-awstatsprog =/usr/local/ awstats-6.9/tools/wwwroot/cgi-bin/AWStats. PL
Logfile = "/home/wwwlogs/Access _ % YYYY-24 % MM-24 % DD-24.log"
log_format main '$ remote_addr-$ remote_user [$ time_local] "$ request"'
'$ Status $ body_bytes_sent "$ http_referer"'
'"$ http_user_agent "" $ http_x_forwarded_for "';