<?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>Ubuntu Tutorials &#187; Server</title>
	<atom:link href="http://ubuntu-tutorials.com/category/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://ubuntu-tutorials.com</link>
	<description>Enhancing your Ubuntu experience!</description>
	<lastBuildDate>Sat, 28 Jan 2012 20:08:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ubuntu Server and WordPress : Published</title>
		<link>http://ubuntu-tutorials.com/2010/09/28/ubuntu-server-and-wordpress-published/</link>
		<comments>http://ubuntu-tutorials.com/2010/09/28/ubuntu-server-and-wordpress-published/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 12:07:07 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[packt]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=1962</guid>
		<description><![CDATA[I mentioned a week or so ago that I would be having another article published in the near future. I&#8217;m happy to announce that the article is now available. I hope you&#8217;ll take a few minutes and head over to have a read. If you have any comments, or suggestions on accuracy or improvements please [...]]]></description>
			<content:encoded><![CDATA[<p>I mentioned a week or so ago that I would be having another article published in the near future. I&#8217;m happy to announce that the article is now available. I hope you&#8217;ll take a few minutes and head over to have a read. If you have any comments, or suggestions on accuracy or improvements please do let me know and I&#8217;ll update where necessary.</p>
<p><a title="Ubuntu Server and WordPress in 15 Minutes Flat" href="http://www.packtpub.com/article/ubuntu-server-and-wordpress-in-15-minutes-flat">﻿﻿Ubuntu Server and WordPress in 15 Minutes Flat</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2010/09/28/ubuntu-server-and-wordpress-published/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Watch Log Files in Realtime</title>
		<link>http://ubuntu-tutorials.com/2009/09/08/watch-log-files-in-realtime/</link>
		<comments>http://ubuntu-tutorials.com/2009/09/08/watch-log-files-in-realtime/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 15:23:52 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[tail]]></category>
		<category><![CDATA[watch]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=1226</guid>
		<description><![CDATA[A very useful tool in any kind of troubleshooting is checking out the log files. Whether you&#8217;re troubleshooting a system problem, monitoring a mail server or simply checking the visitors for a web server the log files are your best friend. There are a few ways to handle this. Probably the most common command used [...]]]></description>
			<content:encoded><![CDATA[<p>A very useful tool in any kind of troubleshooting is checking out the log files. Whether you&#8217;re troubleshooting a system problem, monitoring a mail server or simply checking the visitors for a web server the log files are your best friend. There are a few ways to handle this.</p>
<p>Probably the most common command used to keep an eye on log files is tail. Here are a few examples:</p>
<blockquote><p>tail -f /var/log/syslog</p>
<p>tail -n25 /var/log/mail.log</p>
<p>tail -F /var/log/lighttpd/error.log</p></blockquote>
<p>You&#8217;ll notice that each command above used a different option. Let me explain what each does.</p>
<blockquote><p>-f, &#8211;follow : output appended data as the file grows</p>
<p>-n, &#8211;lines: output the last N lines, instead of the last 10; or use +N to output lines starting with the Nth</p>
<p>-F: same as &#8211;follow &#8211;retry</p>
<p>&#8211;retry: keep trying to open a file even if it is inaccessible when tail starts or if it becomes inaccessible later</p></blockquote>
<p>Also note that ctrl-c will stop the -f or &#8211;follow options.</p>
<p>One thing that I&#8217;ve learned in all my troubleshooting and administration is that the system almost always tells you what the problem is. The trick is to simply know where to look. /var/log/messages, /var/log/syslog and other files in the /var/log/ directory will almost surely have the answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2009/09/08/watch-log-files-in-realtime/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apt-Cacher: Revisited</title>
		<link>http://ubuntu-tutorials.com/2009/09/06/apt-cacher-revisited/</link>
		<comments>http://ubuntu-tutorials.com/2009/09/06/apt-cacher-revisited/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 16:36:45 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[apt-cacher]]></category>
		<category><![CDATA[apt.conf]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=1219</guid>
		<description><![CDATA[I&#8217;m sure that I&#8217;ve mentioned a number of times that the bandwidth speeds at my house are pretty horrible. It is very frustrating to have such a limited pipe considering the amount of work I do that requires bandwidth. Based on this limitation I regularly come up with ways to conserve and cache. One of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure that I&#8217;ve mentioned a number of times that the bandwidth speeds at my house are pretty horrible. It is very frustrating to have such a limited pipe considering the amount of work I do that requires bandwidth. Based on this limitation I regularly come up with ways to conserve and cache. One of these methods (which I have blogged about in the past) is apt-cacher.</p>
<p>Apt-Cacher is a method by which you can centrally cache and share packages already stored within your network. It also allows the option of caching any downloaded packages in the future. This allows me to download a package once and transparently share it with an unlimited number of machines within my network. This way I only use my Lanwidth (LAN-bandwidth), and not my limited WAN connection.</p>
<p>Apt-Cacher can be installed and configured network wide in five simple steps. These steps are:</p>
<ul>
<li>Install</li>
<li>Autostart daemon</li>
<li>Configure ACL</li>
<li>Import current packages</li>
<li>Configure Clients</li>
</ul>
<p>To be honest, the first four steps are finished in just a few minutes. The last step of configuring your clients can take longer. The amount of time depends on how many clients you have.</p>
<p><strong>Install</strong></p>
<p>To install apt-cacher simply install the package (or click the link below):</p>
<blockquote><p><code>sudo aptitude install <a title="apt-cacher package" href="apt://apt-cacher">apt-cacher</a></code></p></blockquote>
<p><strong>Autostart daemon</strong></p>
<p>If you want the apt-cacher daemon to autostart at boot you&#8217;ll need to change a single value in the config:</p>
<blockquote><p><code>sudo sed -i.orig 's/AUTOSTART=0/AUTOSTART=1/' /etc/default/apt-cacher</code></p></blockquote>
<blockquote><p><code>sudo /etc/init.d/apt-cacher restart</code></p></blockquote>
<p><strong>Configure ACL</strong></p>
<p>This step is optional. By default apt-cacher will allow access to any IP. If you would like to limit access to your cache from a specific subnet or other specific addresses you&#8217;ll need to change the values for allowed_hosts and denied_hosts in the /etc/apt-cacher/apt-cacher.conf.</p>
<p><strong>Import current packages</strong></p>
<p>You&#8217;ll likely want to import the current packages that you have in your machine&#8217;s package cache. This can be done using the command:</p>
<blockquote><p><code>sudo /usr/share/apt-cacher/apt-cacher-import.pl -s /var/cache/apt/archives/</code></p></blockquote>
<p>At this point this machine will have the ability to share any packages that it has previously downloaded as well as any package that it (or any client) will download in the future. The only requirement to begin using this cache throughout your network is configuring the clients to use it.</p>
<p><strong>Configure Clients</strong></p>
<p>To configure your clients to use your cache you can simply add a line to your apt.conf file, telling the client to use the cache server. To do this add the following line to your /etc/apt/apt.conf file, replacing the IP with your own:</p>
<blockquote><p><code>Acquire::http::Proxy "http://192.168.0.30:3142"</code></p></blockquote>
<p>You&#8217;re now done. As long as your apt-cacher is accessible your client will look there for cached packages.</p>
<p>If anyone knows of a method to allow for multiple proxy entries I would be very interested. For example, if this were configured on a laptop and the apt-cacher were not accessible, I would like the client to transparently try the next entry in a list. This is something available in many other package managers, I would hope Debian based distributions would support the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2009/09/06/apt-cacher-revisited/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Configure BIND 9 For IPv4 (or IPv6) Only</title>
		<link>http://ubuntu-tutorials.com/2009/03/21/configure-bind-9-for-ipv4-or-ipv6-only/</link>
		<comments>http://ubuntu-tutorials.com/2009/03/21/configure-bind-9-for-ipv4-or-ipv6-only/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 23:39:23 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[ipv4]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[named]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=1024</guid>
		<description><![CDATA[I&#8217;m running a slave DNS server on the machine that runs this website.  It is one of three DNS servers (one master, two slaves) that I have running for my multiple domains.  I recently noticed from my Logwatch output that it was having issues with IPv6 lookups and these were causing timeouts and putting extra [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running a slave DNS server on the machine that runs this website.  It is one of three DNS servers (one master, two slaves) that I have running for my multiple domains.  I recently noticed from my Logwatch output that it was having issues with IPv6 lookups and these were causing timeouts and putting extra notices in my log files.  I decided the best route would be to just turn off IPv6 in BIND altogether.</p>
<p><strong>Configuring named</strong></p>
<p>The named man page (man named) lists two options for supporting IPv4 or IPv6.  Each of these commands are mutually exclusive, meaning using one of the options will not allow you to use the other.  Either IPv4 or iPv6, not both.  Now the default is to use both, so if you want to continue supporting lookups on IPv4 and IPv6 there is nothing more you need to do.  If you want to *only* use one or the other you can use the -4 or -6 options in the configuration.</p>
<p>IPv4 only (<code>/etc/default/bind9</code>):</p>
<blockquote><p><code># run resolvconf?<br />
RESOLVCONF=yes<br />
# startup options for the server<br />
OPTIONS="-4 -u bind"</code></p></blockquote>
<p>IPv6 only (<code>/etc/default/bind9</code>):</p>
<blockquote><p><code># run resolvconf?<br />
RESOLVCONF=yes<br />
# startup options for the server<br />
OPTIONS="-6 -u bind"</code></p></blockquote>
<p>Once you have updated this file and defined the option you want, you&#8217;ll simply need to restart the BIND service and it&#8217;ll start listening on or or the other but, again, not both.</p>
<blockquote><p><code>sudo /etc/init.d/bind9 restart</code></p></blockquote>
<p>My BIND installation is now listening on only IPv4 and I have yet to see the same slowdown or amount of log output that I used to.  I guess, when we start using IPv6 one of these days I&#8217;ll need to change it, but I don&#8217;t have a lot of faith in that happening anytime soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2009/03/21/configure-bind-9-for-ipv4-or-ipv6-only/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Email Notification of Available Updates: Ubuntu/Debian Server</title>
		<link>http://ubuntu-tutorials.com/2009/02/21/email-notification-of-available-updates-ubuntudebian-server/</link>
		<comments>http://ubuntu-tutorials.com/2009/02/21/email-notification-of-available-updates-ubuntudebian-server/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 05:04:20 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=937</guid>
		<description><![CDATA[At work we run a number of Red Hat Enterprise machines and CentOS servers.  After finding a large number of machines that were grossly outdated I decided to add a weekly cron job to notify us of available updates.  I used something along the lines of: #!/bin/bash yum check-update &#124; mail -s &#8220;Weekly Errata Report [...]]]></description>
			<content:encoded><![CDATA[<p>At work we run a number of Red Hat Enterprise machines and CentOS servers.  After finding a large number of machines that were grossly outdated I decided to add a weekly cron job to notify us of available updates.  I used something along the lines of:</p>
<blockquote><p>#!/bin/bash</p>
<p>yum check-update | mail -s &#8220;Weekly Errata Report for $(hostname)&#8221; admin@domain.tld</p></blockquote>
<p>After dropping this little one-liner into /etc/cron.weekly/ we&#8217;re now notified of available package updates on a weekly basis, and our machines are keeping up to date much better!</p>
<p>I got to thinking this evening about how to achieve the same results on my Ubuntu and Debian servers.  There does not seem to be an equivalent command to &#8216;<strong>yum check-update</strong>&#8216;, but there appears to be a similar solution.</p>
<blockquote><p>#!/bin/bash</p>
<p>(apt-get update &amp;&amp; apt-get -s safe-upgrade &amp;&amp; apt-get -s full-upgrade) | mail -s &#8220;Weekly Errata Report for $(hostname)&#8221; admin@domain.tld</p></blockquote>
<p>The apt-get equivalent command above is a bit more verbose but it basically does the same thing.  note: the parens are required so that the collective output of the three commands will be piped to the mail utility.</p>
<p>Does anyone else have any suggestions an how to accomplish this with standard Ubuntu/Debian tools?</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2009/02/21/email-notification-of-available-updates-ubuntudebian-server/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Monitor System Logs With Logwatch</title>
		<link>http://ubuntu-tutorials.com/2008/11/13/monitor-system-logs-with-logwatch/</link>
		<comments>http://ubuntu-tutorials.com/2008/11/13/monitor-system-logs-with-logwatch/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 17:10:15 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[logwatch]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[reporting]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/?p=736</guid>
		<description><![CDATA[I mentioned in a recent post regarding postfix smtp via Gmail that I use the logwatch utility for monitoring my systems.  Ever since I found this utility I have really enjoyed the daily snapshot that it gives me of each of my systems, whether local or remote.  Everything from package installed and removed, to security [...]]]></description>
			<content:encoded><![CDATA[<p>I mentioned in a recent post regarding <a title="postfix smtp via gmail" href="http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/">postfix smtp via Gmail</a> that I use the logwatch utility for monitoring my systems.  Ever since I found this utility I have really enjoyed the daily snapshot that it gives me of each of my systems, whether local or remote.  Everything from package installed and removed, to security notifications regarding unsuccessful login attempts.  Here&#8217;s how to install and configure Logwatch.</p>
<p><strong>Install The Package</strong></p>
<blockquote><p><code>sudo aptitude install <a title="logwatch package" href="apt://logwatch">logwatch</a></code></p></blockquote>
<p><strong>Configuration</strong></p>
<p>The default configuration can be found in /usr/share/logwatch/default.conf/logwatch.conf.  Take a look around the file, but the main thing you might want to update:</p>
<blockquote><p><code>MailTo = root</code> updates to <code>MailTo = user.name@domain.tld</code></p></blockquote>
<p>I have my systems email me daily at my gmail address, so each morning I get an overview of the previous days logs.</p>
<p>If you have problems with the mail actually getting out you might want to check out my post regarding <a title="postfix smtp via gmail" href="http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/">Postfix smtp via Gmail</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/11/13/monitor-system-logs-with-logwatch/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Configure Listadmin : Command Line Mailman Moderation</title>
		<link>http://ubuntu-tutorials.com/2008/02/02/how-to-configure-listadmin-command-line-mailman-moderation/</link>
		<comments>http://ubuntu-tutorials.com/2008/02/02/how-to-configure-listadmin-command-line-mailman-moderation/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 19:24:37 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/2008/02/02/how-to-configure-listadmin-command-line-mailman-moderation/</guid>
		<description><![CDATA[First of all I need to thank Daniel for turning me onto this tool. I&#8217;m administrator on more lists than I&#8217;d prefer and this has been a godsend! If you happen to be one that missed his post recently on the planet, or if you&#8217;re just finding this via Google, Listadmin is a tool to [...]]]></description>
			<content:encoded><![CDATA[<p>First of all I need to thank <a title="Daniel Holbach - Listadmin Tool" href="http://daniel.holba.ch/blog/?p=78">Daniel</a> for turning me onto this tool.  I&#8217;m administrator on more lists than I&#8217;d prefer and this has been a godsend!</p>
<p>If you happen to be one that missed his post recently on the planet, or if you&#8217;re just finding this via Google, Listadmin is a tool to help you bulk moderate mailman lists.  If you are the admin or moderator on more than one mailman list do yourself a favor and keep reading.  If you have no idea what I&#8217;m talking about, well, thanks for the visit anyway.</p>
<p><strong>Installation</strong></p>
<p>Installing Listadmin is just as simple as installing anything else really.  Use the following command (or click the link using apturl):</p>
<blockquote><p><code>sudo aptitude install <a title="listadmin - command line mailman moderation tool" href="apt://listadmin">listadmin</a></code></p></blockquote>
<p><strong>Configuration</strong></p>
<p>Before we can begin moderating our lists we&#8217;ll need to tell Listadmin which lists to moderate.  This is done by creating a file in your home directory <code>~/.listadmin.ini</code></p>
<p>With your favorite editor create the file and follow the below example, replacing with your own information:</p>
<blockquote><p><code>default skip<br />
log ~/.listadmin.log</code></p></blockquote>
<blockquote><p><code># this example uses the same password<br />
# for the users, process and admin lists<br />
adminurl http://{domain}/mailman/admindb/{list}<br />
password mypassword<br />
users@lists.example.org<br />
process@lists.example.org<br />
admin@lists.example.org<br />
</code></p></blockquote>
<blockquote><p><code># this example uses different passwords<br />
# for the supporters and staff lists<br />
adminurl https://{domain}/mailman/admindb/{list}<br />
</code></p></blockquote>
<blockquote><p><code>password "myotherpassword"<br />
supporters@lists.example.com<br />
</code></p></blockquote>
<blockquote><p><code>password "mythirdpassword"<br />
staff@lists.example.com</code></p></blockquote>
<p>As you can see the configuration is pretty simple.  The address to the list, the password needed and the lists you want to moderate.</p>
<p>If the lists use the same password you can list them under a single password block.</p>
<p>If the lists use different passwords you can list the by individual password and address.</p>
<p>Once you&#8217;ve replaced the details with your own information there is one more step before we run the utility.  Considering this file holds sensitive passwords you&#8217;ll want to limit access to the file.</p>
<blockquote><p><code>chmod go-r .listadmin.ini</code></p></blockquote>
<p>Go ahead now and launch the tool and moderate your lists:</p>
<blockquote><p><code>listadmin</code></p></blockquote>
<p>I&#8217;ve been using this now for only two days or so but I&#8217;m so thankful I found it.  Instead of manually moderating a large number of lists I simply run this tool once a day, clean out the garbage and get back to <em>real</em> work.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/02/02/how-to-configure-listadmin-command-line-mailman-moderation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring AWStats on Ubuntu Server</title>
		<link>http://ubuntu-tutorials.com/2008/01/16/configuring-awstats-on-ubuntu-server/</link>
		<comments>http://ubuntu-tutorials.com/2008/01/16/configuring-awstats-on-ubuntu-server/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 20:51:47 +0000</pubDate>
		<dc:creator>Christer Edwards</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[awstats]]></category>

		<guid isPermaLink="false">http://ubuntu-tutorials.com/2008/01/16/configuring-awstats-on-ubuntu-server/</guid>
		<description><![CDATA[Last nite I sat down and configured AWStats on my Ubuntu 7.10 server. I had previously been using statcounter, a free stat service, but I had noticed that it was one of the causes of slowdown on my page loads. Having to access an external site and javascript wasn&#8217;t helping. I also run the server [...]]]></description>
			<content:encoded><![CDATA[<p>Last nite I sat down and configured AWStats on my Ubuntu 7.10 server.  I had previously been using statcounter, a free stat service, but I had noticed that it was one of the causes of slowdown on my page loads.  Having to access an external site and javascript wasn&#8217;t helping.  I also run the server so I have full access to the server logs, why not just use those directly.</p>
<p>So far I am really happy with AWStats.  It appears to be running properly and pulling in a lot more data than statcounter ever did.  It actually is showing me that I had much more traffic than I thought.  I had mentioned 5,000 the other day, which I have long since surpassed based on AWStats output.</p>
<p>I&#8217;d like to share the steps I took for installing and configuring AWStats on my Ubuntu Server.</p>
<p><strong>Installation</strong></p>
<p>Ubuntu has the AWStats package available in the repositories, which we can install with:</p>
<blockquote><p><code>sudo aptitude install <a title="awstats - web statistics for your server" href="apt://awstats">awstats</a></code></p></blockquote>
<p>This will install the basic files, but there is still a bit of configuring to do, so we&#8217;ll dive into that next.</p>
<p><strong>Auto Configuration</strong></p>
<p>From the tutorials that I found elsewhere in my searching there is a awstats_configure.pl file that will try to configure it for you.  I did not use this personally, but if you&#8217;d like to try it you can run:</p>
<blockquote><p><code>sudo perl /usr/share/doc/awstats/examples/awstats_configure.pl</code></p></blockquote>
<p>The rest of this tutorial will discuss manual configuration, but if anyone can offer feedback concerning the configure script I&#8217;m sure many would be interested.</p>
<p><strong>Manual Configuration</strong></p>
<p>I configured my system manually, which I will outline below.  The only requirements here are that you have access to the apache2 logs, or that you have custom log locations for each of your virtual domains (if used).  For more information on custom log locations for virtual domains see my previous post, <a title="Configure virtual hosting on ubuntu with apache2 - name based virtual hosting on ubuntu" href="http://ubuntu-tutorials.com/2008/01/09/setting-up-name-based-virtual-hosting/">Configuring Virtual Hosting on Ubuntu with Apache2</a>.</p>
<p>The first step is creating an awstats.conf file for your domain.  This can be done by moving or copying the <em>/etc/awstats.conf</em>, and giving it a more unique name:</p>
<blockquote><p><code>sudo cp /etc/awstats/awstats.conf /etc/awstats/awstats.domain.tld.conf</code></p></blockquote>
<p>I created a unique file, using the syntax awstats + domain.tld + conf for each of the domains hosted on my server.  Each of these also has their own unique log file as well.</p>
<p>We&#8217;ll then edit our new <em>/etc/awstats</em> with custom values for that domain.  The main points you&#8217;ll want to look for within this file:</p>
<ul>
<li>LogFile=&#8221;/path/to/your/domain/access.log&#8221;</li>
<li>LogFormat=1 (this will give you more detailed stats)</li>
<li>SiteDomain=&#8221;domain.tld&#8221;</li>
<li>HostAliases=&#8221;www.domain.tld localhost 127.0.0.1&#8243;</li>
</ul>
<p>Once you&#8217;ve made these changes you&#8217;ll want to build your initial statistics, which will be generated from the current logs on your machine.  We can do this using:</p>
<blockquote><p><code>sudo /usr/lib/cgi-bin/awstats.pl -config=domain.tld -update</code></p></blockquote>
<p>What this will do is scan the <em>/etc/awstats</em> folder for anything of the pattern awstats + domain.tld + conf, reading that config to generate its output.  You should see some output here, and depending on the size of your logs it&#8217;ll take anywhere from a few seconds to a few minutes or hours.  Each time it is run after that will be minimal, as it only updates the information, but the initial generation can take some time.</p>
<p><strong>Configure Apache to Display AWStats</strong></p>
<p>At this point our statistics should be generated (if not, go back and double check you haven&#8217;t missed anything!), but we need a way to see them.  We&#8217;ll need to configure Apache2 to show us these stats.  The way I did this was by using an Include in my <em>apache2.conf</em>, instead of cluttering up the default config file.  This is generally my preferred method.</p>
<p>Apache2.conf already has a line near the botton Include <em>/etc/apache2/conf.d/</em>, which will read anything in there as additional data.  What  I did was create a new file in the <em>/etc/apache2/conf.d/</em> directory called <em>awstats</em>, and filled it with the following content:</p>
<blockquote><p><code>Alias /awstatsclasses "/usr/share/awstats/lib/"<br />
Alias /awstats-icon/ "/usr/share/awstats/icon/"<br />
Alias /awstatscss "/usr/share/doc/awstats/examples/css"<br />
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<br />
ScriptAlias /awstats/ /usr/lib/cgi-bin/<br />
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch</code></p></blockquote>
<p>This is basically creating some access aliases, and defining the cgi-bin paths, etc.  Once this is saved you should be able to restart Apache2 and we&#8217;ll should be able to access our stats.  Restart Apache2 using:</p>
<blockquote><p><code>sudo /etc/init.d/apache2 restart</code></p></blockquote>
<p>You should now be able to access your statistics using:</p>
<blockquote><p><code>http://domain.tld/awstats/awstats.pl</code></p></blockquote>
<p>Assuming you didn&#8217;t get any errors during your stats generation, and Apache2 didn&#8217;t complain when you restarted the service, you should see statistics at this point.</p>
<p><strong>Continually Updating Your Stats</strong></p>
<p>The last thing you&#8217;ll probably want to do is update your statistics via cron.  This will allow you to have your site statistics updated on a regular basis, not requiring intervention on your part.  What I have done is added a line to my <em>/etc/crontab</em> file telling AWStats to update every ten minutes.  I have seen minimal system load even when updating a dozen sites on that interval.  To update every ten minutes we&#8217;ll add the following line:</p>
<p>*/10 *  * * *   root    /usr/lib/cgi-bin/awstats.pl -config=domain.tld -update &gt;/dev/null</p>
<p>Repeat this line, updating the domain.tld value for any site you want continually updated.</p>
<p><strong>Securing Statistics</strong></p>
<p>If you&#8217;d like to make your statistics private you might be interested in one of my previous posts, <a title="limiting access to directories with .htaccess - access restriction .htaccess - .htaccess tutorial" href="http://ubuntu-tutorials.com/2007/10/06/limiting-access-to-websitesdirectories-with-htaccess/">Limiting Access To Websites &amp; Directories with .htaccess</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntu-tutorials.com/2008/01/16/configuring-awstats-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic (User agent is rejected)
Database Caching 4/43 queries in 0.027 seconds using disk: basic
Object Caching 487/583 objects using disk: basic

Served from: ubuntu-tutorials.com @ 2012-02-08 08:54:03 -->
