Install and use the "AWStats" software for "website traffic access statistics" in Linux

Source: Internet
Author: User
Tags drupal

1. download the latest AWStats from the official website and decompress it.
# Unzip awstats-6.95.zip
# Music Video awstats-6.95/usr/local/AWStats

2. install and configure AWStats. Take the website phpadmin.dean.com on my server as an example. Change the website address as needed.

[root@server56 LAMP]# cd /usr/local/awstats/[root@server56 awstats]# mkdir -m 755 data[root@server56 awstats]# perl tools/awstats_configure.pl 

-----> Check for Web Server install
Found web server Apache Config File '/etc/httpd. conf' <============== read your httpd configuration file

-----> Check and complete Web Server Config File '/etc/httpd. conf'
All AWStats directives are already present.

-----> Update model Config File '/usr/local/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 <=================== the first time you need to create a new config fiel

-----> Define config file name to create
What is the name of your web site or profile analysis?
Example: www.mysite.com
Example: Demo
Your web site, virtual server or profile name:
> Phpadmian.dean.com <====================== enter the URL you want to record here, of course, on your own httpd server

-----> 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 ):
> <===================== Configuration file storage path. Generally, the default value is/etc/AWStats. Press enter.

-----> Create Config File '/etc/AWStats/awstats.phpadmin.dean.com. conf'
Config file/etc/AWStats/awstats.phpadmin.dean.com. conf created.

-----> Add update process inside a scheduler
Sorry, configure. pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/Usr/local/AWStats/wwwroot/cgi-bin/AWStats. pl-Update-Config = phpadmin.dean.com
Or if you have several config files and prefer having only one command:
/Usr/local/AWStats/tools/awstats_updateall.pl now
Press enter to continue... <============================== press enter to create...

A simple config file has been created:/etc/AWStats/awstats.phpadmin.dean.com. conf
You shoshould have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'phpadmin .dean.com 'with command:
> Perl AWStats. pl-Update-Config = phpadmin.dean.com
You can also read your statistics for 'phpadmin .dean.com 'with URL:
> Http: // localhost/AWStats. pl? Config = phpadmin.dean.com

Press enter to finish... <================ created successfully, press enter to exit

3. modify the configuration file/etc/AWStats/awstats.drupal.dean.com. conf, find the line of logfile, repair it to the access log path of your website, and add a datadir pointing to the data directory created above.

vim /etc/awstats/awstats.drupal.dean.com.conf

Logfile = "/usr/local/Apache/logs/druap.dean.com-access_log"

Datadir = "datadir ="/usr/local/AWStats/Data"

4. Generate the statistics log webpage.
1) first create the/var/lib/AWStats directory. Otherwise, an error is reported when the log web page is generated.

mkdir /var/lib/awstats

2) Make sure that the access log format of your website is combined. Otherwise, an error is reported.
This means each line in your web server log file need to have "combined log format" like this:
3) Make sure that AWStats. pl has the execution permission. Otherwise, the log web page cannot be generated.

chmod +x /usr/local/awstats/wwwroot/cgi-bin/awstats.pl

4) generate a log webpage

cd /usr/local/awstats/wwwroot/cgi-binperl awstats.pl updata -config=phpadmin.dean.com

5. view the log webpage
In the browser enter: http://phpadmin.dean.com/awstats/awstats.pl? Config = phpadmin.dean.com
The effect is as follows:

6. You can run the preceding commands in crontab and specify the update frequency and time as needed:

33 6 ***/usr/local/AWStats/wwwroot/cgi-bin/AWStats. pl-Update-Config = phpadmin.dean.com>/dev/null 2> & 1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.