<?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>arkinEx Codex &#187; debian</title>
	<atom:link href="http://www.arkinex.com/contains/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arkinex.com</link>
	<description>the place where all my code can be viewed</description>
	<lastBuildDate>Wed, 04 Nov 2009 20:39:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installing and Configuring Eggdrop on Debian</title>
		<link>http://www.arkinex.com/guides/65/install-eggdrop-debian/</link>
		<comments>http://www.arkinex.com/guides/65/install-eggdrop-debian/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 19:25:14 +0000</pubDate>
		<dc:creator>arkin</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[eggdrop]]></category>
		<category><![CDATA[irc]]></category>

		<guid isPermaLink="false">http://www.arkinex.com/?p=65</guid>
		<description><![CDATA[An eggdrop is a popular IRC bot that handles users and maintains certain rules &#038; other things on your IRC channels. Eggdrops are useful to have on networks that don&#8217;t have IRC services such as Efnet and also useful when you need a certain service such as 24.7 channel logs for statistics (pisg) or quotes [...]]]></description>
			<content:encoded><![CDATA[<p>An eggdrop is a popular IRC bot that handles users and maintains certain rules &#038; other things on your IRC channels. Eggdrops are useful to have on networks that don&#8217;t have IRC services such as Efnet and also useful when you need a certain service such as 24.7 channel logs for statistics (<a href="http://pisg.sourceforge.net/" target="_blank">pisg</a>) or quotes in your channel.</p>
<p>The following guide will show you how to install the latest Eggdrop on Debian Etch/Lenny (and probably most other Debian/Ubuntu distributions/versions.)<br />
<span id="more-65"></span><br />
First of all, make sure you are root; we want to install the main eggdrop repository. This will download and install the latest eggdrop version.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># apt-get install eggdrop</span></pre></div></div>

<p>It is advised that you have a user setup for eggdrop, in this example, my user is &#8216;<strong>eggdrops</strong>&#8216; with the eggdrop directory &#8216;<strong>/home/eggdrops/eggdrop1/</strong>&#8216;.</p>
<p>We need to copy a sample configuration file, after extracting it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># gzip -d /usr/share/doc/eggdrop-data/examples/eggdrop.conf.gz</span>
root<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># cp /usr/share/doc/eggdrop-data/examples/eggdrop.conf /home/eggdrops/sample.conf</span>
root<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># chown eggdrops:eggdrops /home/eggdrops/sample.conf</span>
root<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># su eggdrops &amp;&amp; cd</span></pre></div></div>

<p>If you&#8217;ve kept up, we copied the sample configuration and assigned eggdrops user account as the owner and then changed our current terminal to the eggdrops account. Next, we want to copy the sample to our working configuration.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">eggdrops<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># cp sample.conf eggdrop1/eggdrop1.conf</span>
eggdrops<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># cd eggdrop1</span>
eggdrops<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># nano eggdrop1.conf</span></pre></div></div>

<p>You can now edit all your eggdrop settings and then we will launch the eggdrop for the first time. <strong>Note</strong>: Leave all the scripts and modules with the /usr/share/ directory prefix alone, we do not need to duplicate any of these files as they are in the shared folder.</p>
<p>To launch the eggdrop:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">eggdrops<span style="color: #000000; font-weight: bold;">@</span>arkinex:~<span style="color: #666666; font-style: italic;"># eggdrop -m eggdrop1.conf</span></pre></div></div>

<p>And your ready to go, it should join the default channel and once you&#8217;ve setup users you should not need to specify the -m option again.</p>
<p>Hope you enjoyed this guide. If you have any questions, post them as comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arkinex.com/guides/65/install-eggdrop-debian/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rapidswitch; My Dedicated Server Review</title>
		<link>http://www.arkinex.com/reviews/62/dedicated-server-review-rapidswitch/</link>
		<comments>http://www.arkinex.com/reviews/62/dedicated-server-review-rapidswitch/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 12:13:14 +0000</pubDate>
		<dc:creator>arkin</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dedicated]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rapidswitch]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.arkinex.com/?p=62</guid>
		<description><![CDATA[In this post I thought i&#8217;d just write a quick review of my old dedicated server provider; Rapidswitch. Dedicated servers are ideal for individuals and businesses that outgrow their shared and vps hosting plans, expanding the hard drive capacity, memory limits and cpu power. In reality, all you are doing is renting a pre-built computer [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I thought i&#8217;d just write a quick review of my old dedicated server provider; Rapidswitch.</p>
<p><span id="more-62"></span></p>
<p>Dedicated servers are ideal for individuals and businesses that outgrow their shared and vps hosting plans, expanding the hard drive capacity, memory limits and cpu power. In reality, all you are doing is renting a pre-built computer (server) from a company and also renting space in the rack and internet connection.</p>
<p>Enough of the explanation, you probably knew all that anyway.</p>
<p>I purchased my first dedicated from Rapidswitch in June 2008, their setup wizard was easy and quick to navigate and we had our order placed within 5 minutes. After placing our order, we were given an account login to track the progress of our order and were kept up to date with tickets.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">System-Generated Note
The following order has been received and will be setup shortly.
&nbsp;
Processors: Dual Core Intel Core <span style="color: #000000;">2</span> Duo 2.2GHz
Memory: 1GB RAM
Hard Disk: 1x 160GB 7200rpm
OS: Linux - Debian <span style="color: #000000;">4.0</span>
Control Panel: None
Bandwidth: <span style="color: #000000;">4</span>,000GB Bandwidth Per Month
Port Speed: Dedicated 100Mbit Port
......</pre></div></div>

<p>02 Jun 14:16 Staff</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Hi,
&nbsp;
Your order is currently being worked on.
&nbsp;
Regards
Ajaz</pre></div></div>

<p>02 Jun 14:55 Staff</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Hi,
&nbsp;
Your server has been setup <span style="color: #c20cb9; font-weight: bold;">as</span> required and is ready to use.
&nbsp;
Regards
Ajaz</pre></div></div>

<p>From placing our order to recieving a working dedicated server with Debian OS installed, it took around 55 minutes, not too shabby; we were well impressed that we could start work straight after our lunch break. We also got a 2.4Ghz Core2Duo cpu instead of the 2.2Ghz we paid for, not a bad error for Rapidswitch to make.</p>
<p>As explained in my other posts; apache, mysql and php are super easy to install using debian apt-get.</p>
<p>I did come to one major problem during my install and ended up removing part of the kernel, an amateur mistake to make, but I made it. So at 2am, I decided to call technical support and see if anyone was awake; Which was funny because I ended up waking up the technical support guy who was really helpful once he&#8217;d recovered from his snooze. He pointed me and helped me get used to KVoMIP which is basically remote computer at a much more advanced level; kicking in from boot up. Here is a screenshot of my recovery, which was so simple to do.</p>

<a href="http://www.arkinex.com/wp-content/gallery/blog/rapidswitch.png" title="" rel="lightbox[singlepic1]" >
	<img class="ngg-singlepic" src="http://www.arkinex.com/wp-content/gallery/cache/1__150x150_rapidswitch.png" alt="rapidswitch.png" title="rapidswitch.png" />
</a>

<p>Furthermore, I decided to run random speed tests at intervals, they always ranged from 8Mb/s to 12.5Mb/s peak (maximum a 100Mbs port can handle.) So not too shabby their either as the drop to 8 may be caused on the external speed test server or due to the bandwidth being shared at the RapidSwitch end. <strong>Just as a note</strong>; the maximum bandwidth you can use on a 10Mb port is 3,200Gb and the maximum you can use on a 100Mb port is 32,000Gb or 32Tb. Many providers offer deals of unlimited usage on 10Mb ports, I don&#8217;t consider them deals.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">arkin<span style="color: #000000; font-weight: bold;">@</span>venus:~$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>------------<span style="color: #000000; font-weight: bold;">/</span>100MB_nonzero.bin
Length: <span style="color: #000000;">104857600</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>100M<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>application<span style="color: #000000; font-weight: bold;">/</span>octet-stream<span style="color: #7a0874; font-weight: bold;">&#93;</span>
Saving to: <span style="color: #000000; font-weight: bold;">`</span>100MB_nonzero.bin<span style="color: #ff0000;">'
&nbsp;
96% [====================================&amp;gt;  ] 101,432,312 11.2M/s  eta 1s</span></pre></div></div>

<p>Support was great, any questions I had were answered within 10 minutes. Although, I was a little annoyed when one technical support member told me we could purchase our cPanel license and reinstall CentOS ourself using KVoMIP and then the next morning, when purchasing the license we were told we couldn&#8217;t and had to pay an extra &pound;40 for them to install CentOS and install cPanel; both an easy task to do.</p>
<p>All in all, my time with Rapidswitch has been great and there have been no faults; I have been kept up to date by email about planned maintenance (weeks in advance), latency issues and any other information such as electricity prices and company expansion.</p>
<p>I would rate them.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">for</span> Speed
<span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">for</span> Support
<span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">for</span> Cost <span style="color: #7a0874; font-weight: bold;">&#40;</span>but you <span style="color: #000000; font-weight: bold;">do</span> get what you pay for.<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">for</span> Reliability <span style="color: #7a0874; font-weight: bold;">&#40;</span>no downtime apart from <span style="color: #000000;">1</span> night there was a powercut at 5am, back within <span style="color: #000000;">5</span> minutes.<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>I hope my review has helped, there is nearly always an offer on at Rapidswitch, if there isn&#8217;t; wait for one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arkinex.com/reviews/62/dedicated-server-review-rapidswitch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrading Debian Etch (v4) to Debian Lenny (v5) and Kernel 2.6.26</title>
		<link>http://www.arkinex.com/guides/57/upgrading-debian-etch-v4-to-debian-lenny-v5-and-kernal-2626/</link>
		<comments>http://www.arkinex.com/guides/57/upgrading-debian-etch-v4-to-debian-lenny-v5-and-kernal-2626/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 13:02:03 +0000</pubDate>
		<dc:creator>arkin</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dist-upgrade]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.arkinex.com/?p=57</guid>
		<description><![CDATA[Well, seeing as Debian Lenny is almost about to be released, I figured upgrading my server wouldn&#8217;t be a bad idea. Its locked behind a NAT firewall and doesn&#8217;t really do too much so I don&#8217;t think it will be a security issue (especially considering Lenny is soon to be a stable release.) Its really [...]]]></description>
			<content:encoded><![CDATA[<p>Well, seeing as Debian Lenny is almost about to be released, I figured upgrading my server wouldn&#8217;t be a bad idea. Its locked behind a NAT firewall and doesn&#8217;t really do too much so I don&#8217;t think it will be a security issue (especially considering Lenny is soon to be a stable release.)</p>
<p><span id="more-57"></span></p>
<p>Its really quite simple. first of all, open /etc/apt/sources.list</p>
<pre>
nano /etc/apt/sources.list
</pre>
<p>Then, change etch to lenny, so it looks something like this (depending on your region/mirrors etc.)</p>
<pre>
deb http://debian.virginmedia.com/ lenny main
deb-src http://debian.virginmedia.com/ lenny main

deb http://security.debian.org/ lenny/updates main contrib
deb-src http://security.debian.org/ lenny/updates main contrib
</pre>
<p>Save the file and then run apt-get update &#038;&#038; apt-get dist-upgrade.</p>
<pre>
apt-get update &#038;&#038; apt-get dist-upgrade
</pre>
<p>You should then be prompted with information regarding how much disk usage will be used and a long list of packages that will be updated and installed. I think it was an extra 100mb+ for me.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">138</span> upgraded, <span style="color: #000000;">14</span> newly installed, <span style="color: #000000;">1</span> to remove and <span style="color: #000000;">0</span> not upgraded.
Need to get 18.5MB<span style="color: #000000; font-weight: bold;">/</span>56.3MB of archives.
After unpacking 23.3MB of additional disk space will be used.
Do you want to <span style="color: #7a0874; font-weight: bold;">continue</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span>? y</pre></div></div>

<p>Once finished, you should be upgraded to the Lenny build of Debian and Kernel 2.6.26.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arkinex.com/guides/57/upgrading-debian-etch-v4-to-debian-lenny-v5-and-kernal-2626/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Managing Apache2 on Debian Etch</title>
		<link>http://www.arkinex.com/guides/33/managing-apache2-on-debian-etch/</link>
		<comments>http://www.arkinex.com/guides/33/managing-apache2-on-debian-etch/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 15:32:21 +0000</pubDate>
		<dc:creator>arkin</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://www.arkinex.com/?p=33</guid>
		<description><![CDATA[Thought i&#8217;d write a quick guide on managing apache2 once installed and running under debian. Covers log file management, adding virtual hosts (with subdomains) and basic security. During this tutorial, it is important that you have root SSH access to your server. Although this guide is written for Debian, it can be used across many [...]]]></description>
			<content:encoded><![CDATA[<p>Thought i&#8217;d write a quick guide on managing apache2 once installed and running under debian.</p>
<p>Covers log file management, adding virtual hosts (with subdomains) and basic security.<br />
<span id="more-33"></span><br />
During this tutorial, it is important that you have root SSH access to your server.</p>
<p>Although this guide is written for Debian, it can be used across many Linux distributions, you will just need to find the locations of the files mentioned and may need to create some additional files.</p>
<p><strong>Part 1 &#8211; Log File Management</strong></p>
<p>First of all, we will navigate to our log file directory. Log files in debian are normally kept in <em>/var/log</em> and apache log files have their own directory, so <em>/var/log/apache2</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:~# cd /var/log/apache2
mars:/var/log/apache2# ls
access.log  access.log.1  error.log  error.log.1</pre></div></div>

<p>You may also have seperate log files for specific sites on your server.</p>
<p>Error log is normally the most useful and contains all the errors caught by Apache.<br />
It helps us determine hackers and exploiters and general errors from within our site.</p>
<p>We will use the <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?cat">cat</a> and <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?more">more</a> commands to view &amp; limit the output of the log.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/var/log/apache2# cat error.log | more
[Sun Aug 03 14:39:11 2008] [error] [client 125.65.112.135] File does not exist: /var/www/site/cms/favicon.ico
[Sun Aug 03 14:39:14 2008] [error] [client 125.65.112.135] File does not exist: /var/www/site/cms/favicon.ico
[Sun Aug 03 14:44:11 2008] [error] [client 125.65.112.135] File does not exist: /var/www/site/robots.txt, referer: http://your.site.com/
[Sun Aug 03 14:49:11 2008] [error] [client 125.65.112.135] File does not exist: /var/www/site/robots.txt, referer: http://your.site.com/
--More--</pre></div></div>

<p>and/or</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/var/log/apache2# cat access.log | grep 404 | more
mars:/var/log/apache2# cat access.log | grep 404
129.241.50.34 - - [01/Aug/2008:20:11:51 +0100] &quot;GET /support.html HTTP/1.1&quot; 404 359 &quot;-&quot; &quot;boitho.com-dc/0.86 ( http://www.boitho.com/dcbot.html )&quot;
82.36.220.196 - - [01/Aug/2008:20:29:03 +0100] &quot;GET /favicon.ico HTTP/1.1&quot; 404 358 &quot;-&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1&quot;
82.36.220.196 - - [01/Aug/2008:20:29:06 +0100] &quot;GET /favicon.ico HTTP/1.1&quot; 404 358 &quot;-&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1&quot;
--More--</pre></div></div>

<p>This shows us that robots.txt is missing and being requests (by <a href="http://www.robotstxt.org">search engines</a>) and your favicon.ico is also not present (used for bookmark icons &amp; webpage icon in firefox).</p>
<p>If you want to continue through the error log press your space bar, if you want to cancel and do something else, press control+c.</p>
<p>Now we will investigate the above IP address using <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?cat">cat</a>, <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?grep">grep</a> and <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?more">more</a> to pull specific entires from the file and limit them (incase theres alot).</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/var/log/apache2# cat access.log | grep 125.65.112.135 | more
125.65.112.135 - - [02/Aug/2008:07:21:27 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=FF6E471372BF51AF4E81E79401BB2C0AFB6111933982 HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;
125.65.112.135 - - [02/Aug/2008:07:21:27 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=E8DA0FF096B5A4DF4E81E794005023B09FEDA25BA2F8 HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;
125.65.112.135 - - [02/Aug/2008:07:21:27 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=12FC7BCD3E2683FB4E81E79601BB61BEC3540BEC7B0D HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;
125.65.112.135 - - [02/Aug/2008:07:21:27 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=AC0D7A2AC9C426304E81E797005052BD8A83720EF4F0 HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;
&nbsp;
125.65.112.135 - - [02/Aug/2008:07:21:27 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=ED17C0488BDCD4C34E81E7990050BFA51AADCB0A9512 HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;
125.65.112.135 - - [02/Aug/2008:07:21:27 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=B58AD75AA8EF6EDA4E81E79A01BB2B30977E22A9B821 HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;
125.65.112.135 - - [02/Aug/2008:07:21:30 +0100] &quot;GET http://www.wantsfly.com/prx1.php?hash=FF9A1DBB63B403CE4E81E79801BBEF64B8651E15FF6B HTTP/1.0&quot; 404 356 &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;</pre></div></div>

<p>So now we can see, this user has been naughty trying to referal spam us using a website that doesn&#8217;t exist on our server. This is quite common, and the suspected user is obviously forging his user agent (as internet explorer).</p>
<p>If there is one particular IP address or Browser you want to &#8220;count&#8221; you can use the word count <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?wc">wc</a> command.</p>
<p>For this example, I am going to count all pageviews from the IP range 127.0.0&#8230;.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/var/log/apache2# cat access.log | grep 127.0.0 | wc -l
78</pre></div></div>

<p>This shows that 127.0.0.* has accessed 78 files on our server in the log period. The ip address could be replaced with MSIE to count Internet Explorer accesses or Firefox etc.</p>
<p>If you require more examples or additional information, please leave questions in the comments section.</p>
<p><strong>Part 2 &#8211; Adding Apache Virtual Hosts</strong></p>
<p>So, if you are dealing with a default apache2 setup (like I am), your virtual hosts can be found in <em>/etc/apache2/sites-enabled/</em> directory and all these files are loaded as apache reloads. <strong>If you do not have this directory</strong>, add the entries to the end of your main Apache configuration file, and make sure <em>NameVirtualHost *</em> is above them all.</p>
<p>I try and create my virtual hosts in numeric sequence order.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/etc/apache2/sites-enabled# ls
000-default</pre></div></div>

<p>So were gonna create <em><strong>001</strong>-example</em> for example.com. I add all my domains in <em>/var/www</em> and give them all a single letter prefix also, so <em>/var/www/e/example</em> for our example site.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/etc/apache2/sites-enabled# mkdir -p /var/www/e/example
mars:/etc/apache2/sites-enabled# nano 001-example</pre></div></div>

<p>This creates a new file using nano. You can then start adding the configuration.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">&amp;lt;VirtualHost *%gt;
        ServerAdmin webmaster@localhost
        ServerName www.example.com
        ServerAlias example.com example.net  www.example.net
        DocumentRoot /var/www/e/example
&nbsp;
#        ErrorLog /var/log/apache2/error.log
&nbsp;
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
#        LogLevel warn
&nbsp;
#        CustomLog /var/log/apache2/access.log combined
#        ServerSignature On
&amp;lt;/VirtualHost&amp;gt;</pre></div></div>

<p>This adds <em>www.example.com</em> as the main domain, and also adds <em>example.com example.net www.example.net</em> as addon domains. You could also add <em>*.example.com</em> under ServerAlias to pick up <em>anything.example.com</em>.</p>
<p>If you are getting permission errors, dont forget to <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?chown">chown</a> and <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?chmod">chmod</a> your <em>/var/www/e/example</em> directory to the right user with the right permssions.</p>
<p>You will also need to reload apache2 for the changes to take effect.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">mars:/etc/apache2/sites-enabled# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)... waiting .
mars:/etc/apache2/sites-enabled#</pre></div></div>

<p><strong>Part 3 &#8211; Basic Security</strong></p>
<p>In the last part of this guide we will review basic security, the following lines can be added in the <VirtualHost> configuration, in the main configuration file, or even in a .htaccess in the desired directory.</p>
<p>How to block all users except 1 IP address:</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;"># If the REMOTE_ADDR (Ip address) isn't 127.0.0.1.
RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
# On any page (.*), F=Forbidden, L=Last Rule.
RewriteRule .* - [F,L]</pre></div></div>

<p>How to block users to the downloads directory who didn&#8217;t come from your site.</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;"># If the user didn't come from www.mydomain.com or sub.mydomain.com
RewriteRule %{HTTP_REFERER} !^www.mydomain.com [NC,OR]
RewriteRule %{HTTP_REFERER} !^sub.mydomain.com [NC]
# And they are trying to access anything under the downloads/ folder.
# Then redirect them to http://www.mydomain.com/invalid-referer.html
RewriteRule downloads/(.*) /invalid-referer.html [R=302,L]</pre></div></div>

<p>I hope you enjoyed reading this guide, please leave comments if you need help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arkinex.com/guides/33/managing-apache2-on-debian-etch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
