{"id":576,"date":"2011-07-18T11:03:58","date_gmt":"2011-07-18T11:03:58","guid":{"rendered":"http:\/\/blog.nixwind.com\/?p=576"},"modified":"2011-07-18T11:06:38","modified_gmt":"2011-07-18T11:06:38","slug":"awstats-installation","status":"publish","type":"post","link":"https:\/\/blog.nixwind.com\/?p=576","title":{"rendered":"Awstats Installation"},"content":{"rendered":"<p>Awstats is an advanced graphical statistics software that can be used to analyze the webserver logs. Here we can see how we can install awstats on a linux server with Apache.<\/p>\n<p><strong>Installation<\/strong><\/p>\n<p>You can get the latest awstats from <a title=\"Awstats\" href=\"http:\/\/sourceforge.net\/projects\/awstats\/files\/AWStats\/\" target=\"_blank\">here<\/a>. Login to server as root execute the below commands<br \/>\n<code><br \/>\n# cd\u00a0 \/usr\/local\/<br \/>\n# wget http:\/\/sourceforge.net\/projects\/awstats\/files\/AWStats\/7.0\/awstats-7.0.tar.gz<br \/>\n# tar -zxvf awstats-7.0.tar.gz<br \/>\n# mv \/usr\/local\/awstats-7.0 \/usr\/local\/awstats<br \/>\n# cd \/usr\/local\/awstats\/tools\/<br \/>\n# perl awstats_configure.pl<br \/>\n<\/code><br \/>\nThe above script will ask few questions, detect\/modify your apache configuration and will generate an awstats configuration file for the site you specifies.<\/p>\n<p><strong>Configuration<\/strong><\/p>\n<p>Awstats site configuration file path will be :\u00a0 \/etc\/awstats\/<br \/>\nName Format of configuration file : awstats.yoursite.com.conf<\/p>\n<p>Open the configuration file with a desired text editor and check, verify and modify the below entries<\/p>\n<p><em>LogFile<\/em> &#8212;&gt; Log file directive should mention the correct path of the site access log file<br \/>\n<em>SiteDomain<\/em> &#8212;&gt; this directive should mention your domain name<\/p>\n<p><strong>Updating stats<\/strong><\/p>\n<p>You can update stats with the below command<br \/>\n<code># \/usr\/local\/awstats\/wwwroot\/cgi-bin\/awstats.pl -update -config=yoursite.com<\/code><\/p>\n<p>Add it as a cron to generate the statistics periodically<\/p>\n<p><code># crontab -e<\/code><\/p>\n<p style=\"background: #f1f1f1; border: 1px solid;\">0 0 * * * \/usr\/local\/awstats\/wwwroot\/cgi-bin\/awstats.pl -update -config=yoursite.com &gt;\/dev\/null 2&gt;&amp;1<\/p>\n<p><strong>Securing<\/strong><\/p>\n<p>To restrict access and to password protect the statistic information add the below lines in your apache configuration<\/p>\n<p style=\"background: #f1f1f1; border: 1px solid;\">&lt;Files &#8220;awstats.pl&#8221;&gt;<br \/>\nAuthUserFile \/usr\/local\/awstats\/.htpasswd<br \/>\nAuthGroupFile \/path\/to\/.group<br \/>\nAuthName &#8220;Restricted Area&#8221;<br \/>\nAuthType Basic<br \/>\nrequire valid-user<br \/>\n&lt;\/Files&gt;<\/p>\n<p>You need to create a user and password and copy it to the file <em>\/usr\/local\/awstats\/.htpasswd<\/em> to limit the access. Any htpasswd online generator can be used for this, You can find an example one <a title=\"htpasswd generator\" href=\"http:\/\/www.htaccesstools.com\/htpasswd-generator\/\" target=\"_blank\">here <\/a><\/p>\n<p>restart Apache<\/p>\n<p><code>\/etc\/init.d\/httpd restart<\/code><\/p>\n<p><strong>Accessing<\/strong><\/p>\n<p>Awstats of the domain can be viewed with the url,<\/p>\n<p><em>http:\/\/your_server_ip\/<\/em>awstats\/awstats.pl??config=yoursite.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Awstats is an advanced graphical statistics software that can be used to analyze the webserver logs. Here we can see how we can install awstats on a linux server with Apache. Installation You can get the latest awstats from here. Login to server as root execute the below commands # cd\u00a0 \/usr\/local\/ # wget http:\/\/sourceforge.net\/projects\/awstats\/files\/AWStats\/7.0\/awstats-7.0.tar.gz [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[87],"tags":[102,88,89],"_links":{"self":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/576"}],"collection":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=576"}],"version-history":[{"count":4,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/576\/revisions"}],"predecessor-version":[{"id":583,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/576\/revisions\/583"}],"wp:attachment":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}