<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AWStats Archives - LinuxTuto</title>
	<atom:link href="https://www.linuxtuto.com/tag/awstats/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.linuxtuto.com/tag/awstats/</link>
	<description>Linux Sysadmin and DevOps blog</description>
	<lastBuildDate>Mon, 14 Aug 2023 17:30:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.linuxtuto.com/wp-content/uploads/2022/01/cropped-LT_faveicon-32x32.png</url>
	<title>AWStats Archives - LinuxTuto</title>
	<link>https://www.linuxtuto.com/tag/awstats/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">201456972</site>	<item>
		<title>How to Install AWStats with Apache on Debian 12</title>
		<link>https://www.linuxtuto.com/how-to-install-awstats-with-apache-on-debian-12/</link>
					<comments>https://www.linuxtuto.com/how-to-install-awstats-with-apache-on-debian-12/#respond</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Mon, 14 Aug 2023 17:30:05 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[AWStats]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=1521</guid>

					<description><![CDATA[<p>AWStats (Advanced Web Statistics) is an open-source web analytics tool that analyzes and generates comprehensive reports about web server log files. It provides detailed information...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-awstats-with-apache-on-debian-12/">How to Install AWStats with Apache on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>AWStats (Advanced Web Statistics) is an open-source web analytics tool that analyzes and generates comprehensive reports about web server log files. It provides detailed information about various aspects of web traffic and visitor behavior on a website.</p>
<p>It&#8217;s important to note that AWStats relies on server log files, so it may not provide real-time data and requires proper configuration to work effectively.</p>
<p>In this tutorial, we will show you how to install <code>AWStats</code> on Debian 12 OS.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 1: Update Operating System</span></h2>
<p>Update your <b>Debian 12</b> operating system to the latest version with the following command:</p>
<pre><code># apt update &amp;&amp; apt upgrade</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: Install Apache webserver</span></h2>
<p>You can install it via <code>apt</code> package manager by executing the following command.</p>
<pre><code># apt install apache2</code></pre>
<p>Verify the status of the <code>Apache</code> service using <code>systemctl status</code> command:</p>
<pre><code># systemctl status apache2</code></pre>
<p>Output:</p>
<pre><code>● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running)
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 928 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 933 (apache2)
      Tasks: 56 (limit: 2273)
     Memory: 11.2M
        CPU: 1.891s
     CGroup: /system.slice/apache2.service
             ├─933 /usr/sbin/apache2 -k start
             ├─934 /usr/sbin/apache2 -k start
             ├─935 /usr/sbin/apache2 -k start
             └─936 /usr/sbin/apache2 -k start
</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: Install AWStats</span></h2>
<p>To install AWStats, you need to run the following command:</p>
<pre><code># apt install awstats</code></pre>
<p>This command will start the installation process. It will resolve dependencies, run a transaction check, and install the necessary packages.</p>
<p>To get GeoIP information install the following Perl packages:</p>
<pre><code># apt install libgeo-ip-perl libgeo-ipfree-perl</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Configure AWStats</span></h2>
<p>Once the installation routine is completed, edit the file <strong>awstats.conf</strong> as follows:</p>
<pre><code>LogFile="/var/log/apache2/access.log"
LogFormat=1
SiteDomain="your-domain.com"
HostAliases=”www.your-domain.com your-domain.com”
DNSLookup=0
AllowFullYearView=3
LoadPlugin="tooltips"</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Configure Apache for AWStats</span></h2>
<p>Open the Apache configuration file <strong>/etc/apache2/conf-available/awstats.conf</strong> :</p>
<pre><code># nano /etc/apache2/conf-available/awstats.conf</code></pre>
<p>Paste the content as shown below:</p>
<pre><code>Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
</code></pre>
<p>Save and exit the configuration file.</p>
<p>To enable this conf run the command:</p>
<pre><code># ln -s /etc/apache2/conf-available/awstats.conf /etc/apache2/conf-enabled/awstats.conf</code></pre>
<p>Then enable the <code>"cgi"</code> module in Apache:</p>
<pre><code># /usr/sbin/a2enmod cgi</code></pre>
<p>To implement the changes, restart Apache webserver:</p>
<pre><code># systemctl restart apache2</code></pre>
<p>To implement the changes, restart Apache webserver:</p>
<pre><code># systemctl restart apache2</code></pre>
<p>You can see how the installation is progressing by pointing your web browser to:</p>
<pre><code># http://your-domain.com/cgi-bin/awstats.pl</code></pre>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-large wp-image-1522" src="https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-900x428.webp" alt="AWStats Statistic" width="900" height="428" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-900x428.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-300x143.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-768x365.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-1536x730.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-1222x581.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-897x426.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic-684x325.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/08/awstats_statistic.webp 1893w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<p>The top line displays the time when statistics were updated. It probably reads ‘Never updated’. It is all right, you just have to manually run the first update.</p>
<pre><code># /usr/lib/cgi-bin/awstats.pl -config=your-domain.com -update</code></pre>
<p>After it is done, if it is successful, with no errors, you should get some output like:</p>
<pre><code>Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 7.8 (build 20200416)
From data in log file "/var/log/apache2/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 4258
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 4258 new qualified records.</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 6: Secure Your AWStats via .htaccess</span></h2>
<p>A basic, simple way of restricting access is to set up a http password. Open your apache2 configuration file</p>
<pre><code># nano /etc/apache2/sites-available/your-domain.com.conf</code></pre>
<p>Paste the content as shown below:</p>
<pre><code>&lt;Directory /usr/lib/cgi-bin/&gt;
    Options +ExecCGI
    AddHandler cgi-script .cgi
    AuthType Basic
    AuthName 'Password Protected Area'
    AuthUserFile '/usr/lib/cgi-bin/.htpasswd'
    Require valid-user
&lt;/Directory&gt;
</code></pre>
<p>If you don’t  have a password that can be used for this purpose, the command <strong>htpasswd</strong> can do it for you.</p>
<pre><code># htpasswd -cb /usr/lib/cgi-bin/.htpasswd admin Str0ngPassw0rd</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>Congratulations! You have successfully installed <code>AWStats</code> with Apache on your Debian 12 OS.</p>
<p>For additional help or useful information, we recommend you to check  <a href="https://awstats.sourceforge.io/docs/index.html" target="_blank" rel="noopener">the official AWStats documentation.</a></p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-awstats-with-apache-on-debian-12/">How to Install AWStats with Apache on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-awstats-with-apache-on-debian-12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1521</post-id>	</item>
	</channel>
</rss>
