Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install AWStats on Ubuntu system to analyze the logs of server software

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install AWStats on Ubuntu system to analyze the log of server software", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install AWStats on a Ubuntu system to analyze the logs of server software.

AWStats is a Perl-based WEB log analysis tool that develops rapidly on Sourceforge. The advantages over another excellent open source log analysis tool, Webalizer,AWStats, are:

1. Friendly interface: you can call the corresponding language interface directly according to the browser (simplified Chinese version)

two。 Based on Perl: and a good solution to the cross-platform problem, the system itself can run on GNU/Linux or Windows (after installing ActivePerl); the log analysis directly supports Apache format (combined) and IIS format (need to be modified). Although Webalizer also has Windows platform version, it has been lack of maintenance; AWStats can complete the unified statistics of different WEB servers: GNU/Linux/Apache and Windows/IIS servers in its own site with a set of system.

3. Efficiency is relatively high: AWStats output statistics projects are much richer than Webalizer, and the speed can still reach the speed of Webalizer, which is enough for a site with millions of visitors per day.

4. Convenient configuration / customization: the system provides flexible but reasonable configuration rules by default. The default configuration that needs to be modified is no more than 3 and 4 items to start running, and there are still many plug-ins to modify and extend.

5.AWStats 's designers are designed for precise "Human visits", so robot access to many search engines is filtered out, so it is possible that the number counted by other log statistics tools is lower, and visits from within the company can also be filtered through IP filtering settings.

6. Many extended parameter statistics capabilities are provided: using ExtraXXXX series configurations to generate application-specific parameter analysis can be very useful for product analysis.

AWStats is a free, powerful and personalized tool that brings advanced web, traffic, FTP or mail server statistics. This log analyzer displays all possible information contained in your log on several graphical web pages as a CGI or from the command line. It can often quickly process a large number of log files by using part of the archives, and it can analyze log files from major server tools, such as Apache log files s (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and many other websites, Proxy (proxy server), Wap, traffic server, mail server and some FTP servers.

Take a look at this comparison table in the most famous statistical tools (AWStats, Analog, Webalizer,...) What are the characteristics and different ideas between them?

AWStats is a free software distributed under the GNU General Public license. You can look at this license chart and know that you can / cannot do it.

Because the AWStats project comes from online information, but also as a CGI, it can work with large website hosting providers that allow access to Perl,CGI and logs.

Let's take a look at how to configure AWStats in the Ubuntu server:

Install the AWStats package

By default, packages for AWStats can be found in the Ubuntu repository.

You can install it by running the following command:

The code is as follows:

Sudo apt-get install awstats

Next, you need to enable the CGI module of Apache.

Run the following command to start CGI:

The code is as follows:

Sudo a2enmod cgi

Now, restart Apache for the changes to take effect.

The code is as follows:

Sudo / etc/init.d/apache2 restart

Configure AWStats

You need to create a profile for each domain or website for which you want to view statistics. In this example, we will create a configuration file for "test.com".

To do this, you can configure the domain you want to count by copying the default configuration file for AWStats.

The code is as follows:

Sudo cp / etc/awstats/awstats.conf / etc/awstats/awstats.test.com.conf

Now, you need to make some changes in the configuration file:

The code is as follows:

Sudo nano / etc/awstats/awstats.test.com.conf

Modify it like this:

The code is as follows:

# Change to Apache log file, by default it's / var/log/apache2/access.log

LogFile= "/ var/log/apache2/access.log"

# Change to the website domain name

SiteDomain= "test.com"

HostAliases= "www.test.com localhost 127.0.0.1"

# When this parameter is set to 1, AWStats adds a button on report page to allow to "update" statistics from a web browser

AllowToUpdateStatsFromBrowser=1

Save and close the file.

After modifying the configuration file, you need to establish preliminary statistics with the current log of the server. You can do this:

The code is as follows:

Sudo / usr/lib/cgi-bin/awstats.pl-config=test.com-update

The output would look like this:

Configure AWStats for Apache

Next, you need to configure Apache2 to display statistics. Now you need to copy the contents of the "cgi-bin" folder to the Apache default root directory. By default it is in "/ usr/lib/cgi-bin".

Run the following command to complete this step:

The code is as follows:

Sudo cp-r / usr/lib/cgi-bin / var/www/html/

Sudo chown www-data:www-data / var/www/html/cgi-bin/

Sudo chmod-R 755 / var/www/html/cgi-bin/

Test AWStats

Now, you can visit url "http://your-server-ip/cgi-bin/awstats.pl?config=test.com." Check out the AWStats page.

Its page looks like this:

Set up scheduled tasks to update the log

It is recommended that you create a scheduled task to update AWStats's database periodically with newly created log entries, and then the statistics will be updated regularly. This will also save you time.

To do this, you need to edit the "/ etc/crontab" file:

The code is as follows:

Sudo nano / etc/crontab

Add the following line to have AWStats update every ten minutes.

The code is as follows:

* / 10 * root / usr/lib/cgi-bin/awstats.pl-config=test.com-update

Save and close the file.

At this point, I believe you have a deeper understanding of "how to install AWStats on the Ubuntu system to analyze the logs of the server software". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report