<?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>Narnio&#187; awstats</title>
	<atom:link href="http://www.narnio.com/tag/awstats/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.narnio.com</link>
	<description>A day in the life of a software engineer</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:31:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Upgrading my VPS to Debian Etch</title>
		<link>http://www.narnio.com/2008/10/12/upgrading-my-vps-to-debian-etch/</link>
		<comments>http://www.narnio.com/2008/10/12/upgrading-my-vps-to-debian-etch/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 15:25:02 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=216</guid>
		<description><![CDATA[You might have noticed it yesterday, or not . But my blog and several other websites hosted by me went offline yesterday for a couple of hours. Well this had to do with me upgrading the VPS to Debian Etch. So far I ran every website on Debian Sarge, and though it&#8217;s stable they choose [...]]]></description>
			<content:encoded><![CDATA[<p>You might have noticed it yesterday, or not <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . But my blog and several other websites hosted by me went offline yesterday for a couple of hours. Well this had to do with me upgrading the VPS to Debian Etch.</p>
<p>So far I ran every website on Debian Sarge, and though it&#8217;s stable they choose to no longer developer for it nor support it. So it was time to move to a newer version. Wich I did yesterday. Here&#8217;s some of the steps you should take before upgrading to the next version of Debian.</p>
<ul>
<li>Make a full backup of any website&#8217;s / databases / scripts running (don&#8217;t forget your crontab and logrotate files)</li>
<li>Copy the backup to a directory not affected by the upgrade. In my VPS the provider has one folder which will be left untouched, but also pull the backup to a local system (just in case <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</li>
<li>Notify any other users also using your server, don&#8217;t want any suprises to potential paying customers.</li>
</ul>
<p>I was lucky that my hosting provider offers an easy way to upgrade or reinstall a Linux distro on the VPS. Just a couple of mouse clicks and they prepare the VPS for the installation. Please note that this will take up to an hour to complete. Once this base installation is complete you will want to perform the following steps:</p>
<ol>
<li>Un rar the backup of the websites / conf files and scripts (tar xf &lt;<em>tar name</em>&gt;) and move them to the right location.</li>
<li>Setup the proper user account /groups to have access to these files (or your users won&#8217;t be able to upload or change the website&#8217;s any more)</li>
<li>Install apache / PHP and mysql by running the following command:<br />
  apt-get install php5 mysql5-server apache2 mysqllib</li>
<li>Setup the apache conf file to load in your restored conf files (eg: <em>Include /export/conf/apache/*.conf</em>)</li>
<li>Replace the mysql <em>my.cnf</em> with the one you backed up previously</li>
<li>Enable the rewrite and ssl modules of apache (I forgot and got some upset calls <img src='http://www.narnio.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> )</li>
</ol>
<p>From this point on your ready to go. All of the websites should be running without any problems. You do need to configure any other tools you had installed, like <a  title="Article on how to setup AWStats" href="http://www.narnio.com/2008/03/26/setting-up-logrotation-with-awstats/">AWStats </a>/ <a  title="Article on how to setup a Subversion system" href="http://www.narnio.com/2006/12/10/setting-up-a-dedicated-svn-server/">Subversion </a>or anything else. Though these should not require to much configuration as all of the configuration files where included in your backup. At least if you followed a setup similar to <a  href="http://www.narnio.com/2007/08/11/configuring-a-debian-sarge-server-part-1/">my first article on setting up linux</a>.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2008/10/12/upgrading-my-vps-to-debian-etch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up logrotation with AWStats</title>
		<link>http://www.narnio.com/2008/03/26/setting-up-logrotation-with-awstats/</link>
		<comments>http://www.narnio.com/2008/03/26/setting-up-logrotation-with-awstats/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 08:28:50 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.narnio.com/2008/03/26/setting-up-logrotation-with-awstats/</guid>
		<description><![CDATA[One of the first things I did on my new server was setting up log rotation and AWStats. You may be wondering why. Well its easy, logs tend to grow. And I prefer to have a daily log for Apache projects, rather then one large file for the entire time of running. Setting up the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first things I did on my new server was setting up log rotation and AWStats. You may be wondering why. Well its easy, logs tend to grow. And I prefer to have a daily log for Apache projects, rather then one large file for the entire time of running.</p>
<h2><strong>Setting up the logrotation</strong></h2>
<p><strong></strong>By default most servers have this build in. It&#8217;s a program called logrotate, which is pretty handy. It consists out of one general configuration file (/etc/logrotate.conf) and several smaller ones (/etc/logrotate.d/*).</p>
<p>I have added my Apache log rotation configuration to the <em>/etc/logrotate.d/Apache</em> file. What you need to do is set how often and what location to perform the log rotation on. The second thing you can set is steps that must be performed before and after the log rotation, which will come in handy later on.</p>
<p>Add something similar to the following for each website:</p>
<div style="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; width: 100%; border-bottom: black 1px solid"><code>/export/log/domain.com/*.log {<br />
   daily<br />
   missingok<br />
   rotate 100<br />
   compress<br />
   notifempty<br />
   create 640 root adm<br />
   sharedscripts<br />
   prerotate<br />
      /usr/lib/cgi-bin/awstats.pl -config=domain -update<br />
      cd /export/log/domain.com/<br />
   endscript<br />
}</code></div>
<p>These settings will rotate the log files once a day, saving up to 100 files maximum. The <em>notifempty</em> setting makes sure empty files never get rotated and <em>missingok</em> prevents the thing from crashing if files are missing. The part between <em>prerotate</em> and <em>endscript</em> I will explain a bit later on, so be patient.</p>
<h2>The next step is setting up AWStats</h2>
<p>Which should not be difficult as it can be done with:</p>
<div style="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; width: 100%; border-bottom: black 1px solid"><code>apt-get install awstats</code></div>
<p>After this easy step you are going to need to configure it per project, which is not so easy. You will need to copy a default configuration file. This is located in <em>/etc/awstats/</em> and called awstats.conf.</p>
<p>Copy this for each log file you wish to keep statistics of. The file names are to be like:</p>
<p>awstats.&lt;project&gt;.conf</p>
<p>If you&#8217;ve done this then all you need to do is change the <em>LogFile</em> location to the location of your apache file. And set the <em>LogType=w</em> to the file for indicating a website. And set the SiteDomain to the name you want AwStats to display.</p>
<p>Keep in mind that you should not change the location of the configuration files, since this will crash AwStats. Also make sure that the project name you choose is identical to the domain name set up in the log rotate step with <em>-domain</em>.</p>
<h2>Setting up awstats on Apache</h2>
<p>Now that the log files are being processed by AwStats it&#8217;s time to make them available through apache. To do that you will need to add the following to the <a  href="http://httpd.apache.org/docs/2.1/vhosts/">VirtualHost</a> in httpd.conf.</p>
<p><code>ScriptAlias /awstats/ /usr/lib/cgi-bin/<br />
Alias /awstats-icon/ /usr/share/awstats/icon/<br />
&lt;Directory /usr/share/awstats/icon&gt;<br />
  Options None<br />
  AllowOverride None<br />
  Order allow,deny<br />
  Allow from all<br />
&lt;/Directory&gt;</code>Now you can access the statistics by browsing to http://domain.com/awstats/awstats.pl?config=<em>domain</em>.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2008/03/26/setting-up-logrotation-with-awstats/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

