{"id":928,"date":"2011-04-23T20:36:30","date_gmt":"2011-04-23T12:36:30","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=928"},"modified":"2023-06-23T14:15:40","modified_gmt":"2023-06-23T14:15:40","slug":"how-to-install-awstats-on-centos-5-5","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-awstats-on-centos-5-5\/","title":{"rendered":"How to Install Awstats on CentOS 5.5"},"content":{"rendered":"<p>In this guide, we will walk you through the process of installing AWStats on a CentOS server. AWStats is a robust, free tool that generates advanced website statistics in a graphical format. This tutorial is designed for those who have root access to a CentOS server with an Apache server installed and a domain, such as www.my.local, properly configured.<\/p>\n<p>AWStats is a valuable tool for webmasters and website administrators as it provides detailed insights into website traffic, helping you understand your audience better.<\/p>\n<h2>Step 1: Download and Install the RPMForge Repository<\/h2>\n<p>The first step in the installation process is to download and install the RPMForge repository. This can be done using the following commands:<\/p>\n<p>For 32-bit (x86) systems:<\/p>\n<pre>\r\n[root@server ~]# rpm -Uhv http:\/\/apt.sw.be\/redhat\/el5\/en\/i386\/rpmforge\/RPMS\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm\r\n<\/pre>\n<p>For 64-bit (x64) systems:<\/p>\n<pre>\r\n[root@server ~]# rpm -Uhv http:\/\/apt.sw.be\/redhat\/el5\/en\/x86_64\/rpmforge\/RPMS\/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm\r\n<\/pre>\n<h2>Step 2: Install AWStats with Yum Command<\/h2>\n<p>Once the RPMForge repository has been installed, you can proceed to install AWStats using the yum command:<\/p>\n<pre>\r\n[root@server ~]# yum --enablerepo=rpmforge install awstats -y\r\n<\/pre>\n<p>This command will install AWStats and all its dependencies. The installation process may take a few minutes to complete.<\/p>\n<p>Example:<\/p>\n<pre>[root@server ~]# yum --enablerepo=rpmforge install awstats -y\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * addons: centos.maulvi.net\r\n * base: centos.maulvi.net\r\n * epel: ftp.cuhk.edu.hk\r\n * extras: centos.maulvi.net\r\n * rpmforge: fr2.rpmfind.net\r\n * updates: mirror.yourconnect.com\r\naddons                                                        |  951 B     00:00\r\nbase                                                          | 1.1 kB     00:00\r\nepel                                                          | 3.7 kB     00:00\r\nextras                                                        | 2.1 kB     00:00\r\nrpmforge                                                      | 1.1 kB     00:00\r\nupdates                                                       | 1.9 kB     00:00\r\nSetting up Install Process\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package awstats.noarch 0:7.0-2.el5.rf set to be updated\r\n--&gt; Processing Dependency: perl(Geo::IP) for package: awstats\r\n--&gt; Running transaction check\r\n---&gt; Package perl-Geo-IP.i386 0:1.38-1.el5.rf set to be updated\r\n--&gt; Processing Dependency: libGeoIP.so.1 for package: perl-Geo-IP\r\n--&gt; Running transaction check\r\n---&gt; Package geoip.i386 0:1.4.6-1.el5.rf set to be updated\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n=====================================================================================\r\n Package             Arch           Version                   Repository        Size\r\n=====================================================================================\r\nInstalling:\r\n awstats             noarch         7.0-2.el5.rf              rpmforge         1.2 M\r\nInstalling for dependencies:\r\n geoip               i386           1.4.6-1.el5.rf            rpmforge         782 k\r\n perl-Geo-IP         i386           1.38-1.el5.rf             rpmforge         118 k\r\n\r\nTransaction Summary\r\n=====================================================================================\r\nInstall       3 Package(s)\r\nUpgrade       0 Package(s)\r\n\r\nTotal download size: 2.1 M\r\nDownloading Packages:\r\n(1\/3): perl-Geo-IP-1.38-1.el5.rf.i386.rpm                     | 118 kB     00:01\r\n(2\/3): geoip-1.4.6-1.el5.rf.i386.rpm                          | 782 kB     00:13\r\n(3\/3): awstats-7.0-2.el5.rf.noarch.rpm                        | 1.2 MB     00:23\r\n-------------------------------------------------------------------------------------\r\nTotal                                                 52 kB\/s | 2.1 MB     00:41\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing     : geoip                                                         1\/3\r\n  Installing     : perl-Geo-IP                                                   2\/3\r\n  Installing     : awstats                                                       3\/3\r\n\r\nInstalled:\r\n  awstats.noarch 0:7.0-2.el5.rf\r\n\r\nDependency Installed:\r\n  geoip.i386 0:1.4.6-1.el5.rf            perl-Geo-IP.i386 0:1.38-1.el5.rf\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 3: Modify AWStats Apache Configuration<\/h2>\n<p>After AWStats has been installed, you will need to modify the AWStats Apache configuration. This can be done using the vi editor:<\/p>\n<pre>\r\n[root@server ~]# vi \/etc\/httpd\/conf.d\/awstats.conf\r\n<\/pre>\n<p>In the configuration file, add the following lines:<\/p>\n<pre>\r\nAlias \/awstats\/icon\/ \/var\/www\/awstats\/icon\/\r\nScriptAlias \/awstats\/ \/var\/www\/awstats\/\r\n&lt;Directory \/var\/www\/awstats\/&gt;\r\n DirectoryIndex awstats.pl\r\n Options ExecCGI\r\n order deny,allow\r\n allow from all\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p>This configuration allows AWStats to run as a CGI script on your Apache server.<\/p>\n<h2>Step 4: Rename Config File<\/h2>\n<p>Next, you will need to rename the default configuration file to match your domain. This can be done using the mv command:<\/p>\n<pre>\r\n[root@server ~]# mv \/etc\/awstats\/awstats.localhost.localdomain.conf \/etc\/awstats\/awstats.www.my.local.conf\r\n<\/pre>\n<p>This command renames the default configuration file to awstats.www.my.local.conf.<\/p>\n<h2>Step 5: Modify &#8220;SiteDomain&#8221; and &#8220;HostAliases&#8221;<\/h2>\n<p>In the renamed configuration file, you will need to modify the &#8220;SiteDomain&#8221; and &#8220;HostAliases&#8221; lines to match your domain. This can be done using the vi editor:<\/p>\n<pre>\r\nSiteDomain=\"www.my.local\"\r\nHostAliases=\"localhost 127.0.0.1 REGEX[my\\\\.local$] REGEX[^10\\\\.0\\\\.0\\\\.]\"\r\n<\/pre>\n<p>These settings tell AWStats which domain to update.<\/p>\n<h2>Step 6: Update Statistics<\/h2>\n<p>After modifying the configuration file, you need to update the statistics. This can be done using the awstats_updateall.pl script:<\/p>\n<pre>\r\n[root@server ~]# \/usr\/bin\/awstats_updateall.pl now -confdir=\"\/etc\" -awstatsprog=\"\/var\/www\/awstats\/awstats.pl\"\r\n<\/pre>\n<pre>\r\n[root@server ~]# \/usr\/bin\/awstats_updateall.pl now -confdir=\"\/etc\" -awstatsprog=\"\/var\/www\/awstats\/awstats.pl\"\r\nRunning '\"\/var\/www\/awstats\/awstats.pl\" -update -config=www.my.local -configdir=\"\/etc\/awstats\"' to update config www.my.local\r\nCreate\/Update database for config \"\/etc\/awstats\/awstats.www.my.local.conf\" by AWStats version 7.0 (build 1.971)\r\nFrom data in log file \"\/var\/log\/httpd\/access_log\"...\r\nPhase 1 : First bypass old records, searching new record...\r\nSearching new records from beginning of log file...\r\nJumped lines in file: 0\r\nParsed lines in file: 0\r\n Found 0 dropped records,\r\n Found 0 comments,\r\n Found 0 blank records,\r\n Found 0 corrupted records,\r\n Found 0 old records,\r\n Found 0 new qualified records.\r\n<\/pre>\n<p>This command updates the AWStats database with the latest statistics from your Apache log files.<\/p>\n<h2>Step 7: Restart the Apache Service<\/h2>\n<p>Once the statistics have been updated, you need to restart the Apache service for the changes to take effect:<\/p>\n<pre>\r\n[root@server ~]# \/etc\/init.d\/httpd start\r\n<\/pre>\n<p>This command starts the Apache service.<\/p>\n<h2>Step 8: Verify the Installation<\/h2>\n<p>Finally, you can verify the installation by accessing the AWStats interface through your web browser. Replace &#8220;CentOS_server&#8221; with your server&#8217;s IP address or domain name:<\/p>\n<pre>\r\nhttp:\/\/CentOS_server\/awstats\/awstats.pl?config=www.my.local\r\n<\/pre>\n<p>If the installation was successful, you should see the AWStats interface displaying statistics for your website.<\/p>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">rpm -Uhv [URL]<\/span> \u2013 Downloads and installs a package from the specified URL<\/li>\n<li><span class=\"fw-bold\">yum &#8211;enablerepo=rpmforge install awstats -y<\/span> \u2013 Installs AWStats from the RPMForge repository<\/li>\n<li><span class=\"fw-bold\">vi \/etc\/httpd\/conf.d\/awstats.conf<\/span> \u2013 Opens the AWStats Apache configuration file in the vi editor<\/li>\n<li><span class=\"fw-bold\">mv [old file name] [new file name]<\/span> \u2013 Renames a file<\/li>\n<li><span class=\"fw-bold\">\/usr\/bin\/awstats_updateall.pl now -confdir=&#8221;\/etc&#8221; -awstatsprog=&#8221;\/var\/www\/awstats\/awstats.pl&#8221;<\/span> \u2013 Updates AWStats statistics<\/li>\n<li><span class=\"fw-bold\">\/etc\/init.d\/httpd start<\/span> \u2013 Starts the Apache service<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>In conclusion, installing AWStats on a CentOS server involves downloading and installing the RPMForge repository, installing AWStats using the yum command, modifying the AWStats Apache configuration, renaming the default configuration file, modifying the &#8220;SiteDomain&#8221; and &#8220;HostAliases&#8221; settings, updating the statistics, restarting the Apache service, and verifying the installation.<\/p>\n<p>By following this guide, you should be able to successfully install AWStats on your CentOS server and start analyzing your website traffic. For more in-depth tutorials on <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated<\/a> or <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">virtual<\/a> servers, feel free to explore our website.<\/p>\n<p>Remember, understanding your website traffic is crucial for improving your web server performance and meeting your audience&#8217;s needs. Tools like AWStats can provide valuable insights that can help you make informed decisions about your website.<\/p>\n<h2>FAQs<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is AWStats?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">AWStats is a free, open-source advanced web analytics tool that generates detailed website statistics. It is capable of analyzing log files from various servers, including Apache and Microsoft IIS.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Why do I need to modify the AWStats Apache configuration?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Modifying the AWStats Apache configuration allows AWStats to run as a CGI script on your Apache server. This enables you to access AWStats through your web browser.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the &#8220;SiteDomain&#8221; setting in the AWStats configuration file do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscopeitemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8220;SiteDomain&#8221; setting in the AWStats configuration file specifies the main URL or domain of your website. AWStats uses this setting to generate statistics specifically for this domain.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the &#8220;HostAliases&#8221; setting in the AWStats configuration file do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8220;HostAliases&#8221; setting in the AWStats configuration file lists all the possible aliases for your website, such as IP addresses, alternate domain names, and localhost. AWStats uses this setting to correctly attribute all log entries to your website, regardless of how it was accessed.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I verify that AWStats has been installed correctly?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can verify the installation by accessing the AWStats interface through your web browser. If the installation was successful, you should see the AWStats interface displaying statistics for your website.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will walk you through the process of installing AWStats on a CentOS server. AWStats is a robust, free tool that generates advanced website statistics in a&#8230;<\/p>\n","protected":false},"author":6,"featured_media":349,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1107,1065],"tags":[1209,1246,1536],"class_list":["post-928","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-awstats","category-system-administration","tag-awstats","tag-centos-5-5","tag-linux"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=928"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/928\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/349"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}