<?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>PCR&#039;s notepad &#187; servers</title>
	<atom:link href="http://notepad.patheticcockroach.com/category/servers/feed/" rel="self" type="application/rss+xml" />
	<link>http://notepad.patheticcockroach.com</link>
	<description>The area in patheticcockroach.com where the EEG isn&#039;t isoelectric</description>
	<lastBuildDate>Sun, 05 Feb 2012 12:11:36 +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>Installing Freenet on Ubuntu server (command line)</title>
		<link>http://notepad.patheticcockroach.com/2519/installing-freenet-on-ubuntu-server-command-line/</link>
		<comments>http://notepad.patheticcockroach.com/2519/installing-freenet-on-ubuntu-server-command-line/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 17:00:10 +0000</pubDate>
		<dc:creator>David Dernoncourt</dc:creator>
				<category><![CDATA[cryptography]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://notepad.patheticcockroach.com/?p=2519</guid>
		<description><![CDATA[After the Tor command line installation guide, it&#8217;s only logical to carry on with Freenet It&#8217;s a bit sad how both those projects lack of crystal clear command line instructions, as, once again, they would likely benefit the most from users running them on dedicated servers, i.e. most often on GUI-less machines. This guide was [...]]]></description>
			<content:encoded><![CDATA[<p>After the <a href="http://notepad.patheticcockroach.com/2487/installing-and-controlling-a-tor-relay-on-linux-via-command-line-only/">Tor command line installation guide</a>, it&#8217;s only logical to carry on with <a href="http://freenetproject.org">Freenet</a> <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  It&#8217;s a bit sad how both those projects lack of crystal clear command line instructions, as, once again, they would likely benefit the most from users running them on dedicated servers, i.e. most often on GUI-less machines. This guide was made for Ubuntu, but should be remarkably similar on other Linux distributions, apart from the package manager (yum vs apt-get, I guess).</p>
<h2>Installing Java</h2>
<p>The main turn off with Freenet for me is that it&#8217;s written in Java. Once you&#8217;ve installed it you&#8217;ll see for yourself how CPU-intensive it actually is &#8211; much more than Tor (which on the opposite isn&#8217;t too demanding). Anyway, installing Java is now a bit trickier than before, because Oracle got their reference implementation <a href="https://help.ubuntu.com/community/Java">removed from official distribution repositories</a>, but OpenJDK works just as well so that&#8217;s what we&#8217;ll pick.<br />
<code>apt-get install openjdk-6-jdk</code><br />
(that will be about 170 MiB of stuff to install)</p>
<h2>Installing Freenet</h2>
<p>Even though the headless server instructions <a href="http://freenetproject.org/download.html">there</a> are a bit scary, I found them quite sufficient. It&#8217;s not that complicated to install after all (also, maybe after getting warmed up by Tor&#8217;s installation I&#8217;m a little biased, too <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), so I&#8217;ll just list the commands you need to type (obviously, edit the pathes), and they should be pretty self-explanatory:<br />
<code>cd /where/you/want/to/install/it<br />
mkdir someFolder<br />
cd someFolder<br />
wget https://downloads.freenetproject.org/alpha/installer/freenet07.tar.gz --no-check-certificate<br />
tar xzf freenet07.tar.gz</code><br />
Now we need to create a user for Freenet, give it a password and assign them the freenet folder:<br />
<code>useradd someUserName<br />
passwd someUserName<br />
[enter the password twice]<br />
chown someUserName freenet -R</code></p>
<h2>First Freenet launch, configuration</h2>
<p>Connect to the machine where you just installed Freenet as this someUserName, go to the freenet folder and run <em>run.sh</em>:<br />
<code>cd /where/you/want/to/install/it/someFolder/freenet<br />
./run.sh</code><br />
FYI (actually, more for my personal archives ^^), here&#8217;s the output:</p>
<pre>Enabling the auto-update feature
Detecting tcp-ports availability...
Downloading update.sh
Downloading wrapper_Linux.zip
Downloading freenet-stable-latest.jar
Downloading freenet-ext.jar
Downloading the JSTUN plugin
Downloading the UPnP plugin
Downloading seednodes.fref
Installing cron job to start Freenet on reboot...
Installed cron job.
Starting Freenet 0.7...
Please visit http://127.0.0.1:8888/ to configure your node
Finished</pre>
<p>Now, you need to connect to http://127.0.0.1:8888 to configure Freenet. If, as is likely since you&#8217;re reading this tutorial on console-based installation, it&#8217;s not on the same computer as where you are now, you have 2 options:<br />
- follow <a href="http://freenetproject.org/faq.html#fproxy-lan">this</a> to allow external IPs (preferably, just a specific one: yours <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) to connect to your Freenet node<br />
- create an SSH tunnel to your machine (see <a href="http://notepad.patheticcockroach.com/369/tips-to-freedom-on-a-restricted-computer-environment/">the second half of this old post</a>), and then when your browser is configured to use it (NB: don&#8217;t forget to remove &#8220;127.0.0.1&#8243; from the exclusion list, in Firefox called &#8220;no proxy for&#8221;), going to http://127.0.0.1:8888 will actually go to your server.</p>
<p>Well, that&#8217;s pretty much it, now just configure it from the GUI as you wish. Here are a few hints, though:</p>
<ul>
<li>You should increase the RAM available to Freenet. By default it&#8217;s 128, it would be a good idea to at least double it. Actually 512 MiB would be even nicer. Note that you&#8217;ll have to restart Freenet in order for the change to be applied. The RAM can also be configured manually in <em>wrapper.conf</em>:<br />
<code>wrapper.java.initmemory=60<br />
wrapper.java.maxmemory=512</code></li>
<li>You&#8217;ll probably want to review input and output bandwidth settings (although you already had the opportunity to do so during the first launch wizard)</li>
<li>You&#8217;ll want to increase the datastore size (this helps the network) and the client cache (this helps you <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), because during the first launch wizard you aren&#8217;t really given much choice for some reason&#8230; Respectively 50GiB and 25GiB could be fine for instance, although of course you can increase that much more. Note however that whenever you change those settings Freenet will rebuild its database, which means it will be somewhat slower for a while.</li>
<li>Finally, it&#8217;s probably a good idea to install some social plugins such as WebOfTrust and Freetalk (both are official plugins), which will give you access to discussion boards. Other plugins of interest: Sone (kind of a social network), Library (search engine), Freenet Search (search engine too).</li>
</ul>
<h2>Bonus: solving the &#8220;There isn&#8217;t enough entropy available on your system&#8230; Freenet won&#8217;t start until it can gather enough.&#8221; error</h2>
<p>Freenet seems to have massive needs for entropy, and if you happen to run out of it, it might take some time to spontaneously replenish. A quick way to boost this is to generate lots of disk access. I saw the suggestion of <a href="http://www.mail-archive.com/devl@freenetproject.org/msg19942.html">running <code>find / >/dev/null</code></a>, but it didn&#8217;t help a lot for me, maybe because my HD isn&#8217;t that filled. What worked great was to either copy a big directory, or even simpler, to download some large file, like: <code>wget ftp://ftp.free.fr/mirrors/ftp.ubuntu.com/dvd/current/precise-dvd-amd64.iso</code></p>
<h2>Bonus 2: restarting/stopping the node without using the web GUI</h2>
<p>The ./run.sh script can be run with arguments, such as <code>./run.sh restart</code> or <code>./run.sh stop</code></p>
]]></content:encoded>
			<wfw:commentRss>http://notepad.patheticcockroach.com/2519/installing-freenet-on-ubuntu-server-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and controlling a Tor relay on Linux via command line only</title>
		<link>http://notepad.patheticcockroach.com/2487/installing-and-controlling-a-tor-relay-on-linux-via-command-line-only/</link>
		<comments>http://notepad.patheticcockroach.com/2487/installing-and-controlling-a-tor-relay-on-linux-via-command-line-only/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 14:28:36 +0000</pubDate>
		<dc:creator>David Dernoncourt</dc:creator>
				<category><![CDATA[cryptography]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://notepad.patheticcockroach.com/?p=2487</guid>
		<description><![CDATA[Tor say they are always looking for more people to run nodes for their network, yet oddly enough they don&#8217;t provide really simple/straightforward instructions to get a relay working without their GUI, which would be the method of choice for server owners. It is however not too complicated, and here&#8217;s a tutorial that should give [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.torproject.org">Tor</a> say they are always looking for more people to run nodes for their network, yet oddly enough they don&#8217;t provide really simple/straightforward instructions to get a relay working without their GUI, which would be the method of choice for server owners. It is however not too complicated, and here&#8217;s a tutorial that should give enough details for people not willing to think at every step. I used Ubuntu 11.10, for other distributions I guess the main differences will be in the way to deal with the package manager.</p>
<h2>Dealing with package manager stuff</h2>
<p>The first step is to configure the package manager to use Tor&#8217;s repository, because distribution repositories are, as you know, always outdated. On this part, the <a href="https://www.torproject.org/docs/debian.html.en">Tor project documentation (for Ubuntu and Debian)</a> is good enough (NB: <a href="https://www.torproject.org/docs/rpms.html.en">here is the page for Fedora / CentOS / SUSE</a>). Basically:<br />
<code>nano /etc/apt/sources.list</code><br />
and at the bottom, add (for Ubuntu 11.10):<br />
<code>deb http://deb.torproject.org/torproject.org oneiric main</code><br />
You can now proceed to installation:<br />
<code>apt-get install tor tor-geoipdb</code></p>
<h2>Editing the configuration file (torrc)</h2>
<p>Installing Tor this way also starts it, but the default configuration is not to relay any traffic. We now need to configure is as a relay. The configuration file to edit is usually, as mentioned <a href="https://www.torproject.org/docs/faq.html.en#torrc">there</a>, /etc/tor/torrc:<br />
<code>nano /etc/tor/torrc</code><br />
In this file, the settings you&#8217;ll want to look at are:</p>
<ul>
<li>uncomment <code>Log notice file /var/log/tor/notices.log</code> if you want to avoid a notice in ARM (see below for what ARM is)</li>
<li>uncomment <code>ControlPort 9051</code> so that ARM can be used to control and monitor Tor</li>
<li>uncomment <code>ORPort</code> and (optionally but recommended, I guess) change its value to some random available port. That&#8217;s the port that will be used by other nodes to connect to yours</li>
<li>optionally uncomment <code>Nickname</code> and give a name to your node</li>
<li>set <code>RelayBandwidthRate</code> and <code>RelayBandwidthBurst</code>. Those are the maximum bandwidth that can be used by Tor constantly and in burst, respectively. For instance:
<pre>RelayBandwidthRate 5000 KB  # Throttle traffic to 100KB/s (800Kbps)
RelayBandwidthBurst 7000 KB # But allow bursts up to 200KB/s (1600Kbps)</pre>
<p>Beware those values are in Bytes, not bits.</li>
<li>if you have a traffic quota (and don&#8217;t want to blow it), you&#8217;ll want to configure <code>AccountingMax</code> and <code>AccountingStart</code></li>
<li>optionally, you can put your name and (spam protected) e-mail, or even your GPG fingerprint, in <code>ContactInfo</code>. According to the comments it can be used to contact you in case your node goes wild or something.</li>
<li>optionally, you can also configure <code>DirPort</code> to mirror directory information on this port.</li>
<li>finally, the most important part: choose whether you want to be just a relay or an exit node. To be just a relay, set:<br />
<code>ExitPolicy reject *:*</code><br />
To be an exit node, you can either leave at is, or replace the default exit policy (in order to do the later, do read the instructions carefully). Note that being an exit can bring you <a href="https://www.torproject.org/docs/faq-abuse.html#TypicalAbuses">trouble</a> because there&#8217;s always a risk of abuse, so at least do check your country&#8217;s law, the law of your host&#8217;s country, and your host&#8217;s TOS. But I guess you&#8217;re already aware of that anyway.</li>
</ul>
<p>Additionally, if you want to remotely use your node to enter the Tor network to surf yourself, well, I suppose it can be configured using <code>SocksPort</code>, <code>SocksListenAddress</code>, <code>SocksPolicy accept</code> and <code>SocksPolicy reject</code>, but I haven&#8217;t figured out how to do that yet :/</p>
<h2>ARM: a terminal-friendly GUI</h2>
<p>Last step, let&#8217;s install a nice piece of helper software called <a href="http://www.atagar.com/arm/">ARM</a> (for &#8220;anonymizing relay monitor&#8221;), which is basically a nice console-based GUI to monitor and have some control over Tor. On Ubuntu 11.10 it&#8217;s as simple as:<br />
<code>apt-get install tor-arm</code></p>
<p>In order to use ARM, you&#8217;ll have to enable Tor control port first. You already entered it in the configuration file (if you followed the guide properly, at least), so we just need to apply the configuration:<br />
<code>/etc/init.d/tor reload</code></p>
<p>Now you can just type <code>arm</code> to launch ARM and view some neat information about your node, like the traffic graph, inbound and outbound nodes, etc.</p>
<h2>Bonus: what&#8217;s a stable node, what&#8217;s a guard node?</h2>
<p>A little bonus, because that&#8217;s something that puzzled me for a while: on some <a href="http://notepad.patheticcockroach.com/2500/lists-of-tor-nodes">Tor node listings</a>, you can see that servers have flags, notably some servers are flagged as &#8220;guard&#8221; and some are flagged as &#8220;stable&#8221;. If you&#8217;re curious about what it means, here it is, right from the <a href="https://gitweb.torproject.org/torspec.git/blob_plain/HEAD:/dir-spec.txt">specification</a>:</p>
<pre>"Guard" -- A router is a possible 'Guard' if its Weighted Fractional
Uptime is at least the median for "familiar" active routers, and if
its bandwidth is at least median or at least 250KB/s.

	To calculate weighted fractional uptime, compute the fraction
	of time that the router is up in any given day, weighting so that
	downtime and uptime in the past counts less.

	A node is 'familiar' if 1/8 of all active nodes have appeared more
	recently than it, OR it has been around for a few weeks.

"Stable" -- A router is 'Stable' if it is active, and either its Weighted
MTBF is at least the median for known active routers or its Weighted MTBF
corresponds to at least 7 days. Routers are never called Stable if they are
running a version of Tor known to drop circuits stupidly.  (0.1.1.10-alpha
through 0.1.1.16-rc are stupid this way.)

	To calculate weighted MTBF, compute the weighted mean of the lengths
	of all intervals when the router was observed to be up, weighting
	intervals by $\alpha^n$, where $n$ is the amount of time that has
	passed since the interval ended, and $\alpha$ is chosen so that
	measurements over approximately one month old no longer influence the
	weighted MTBF much.

	[XXXX what happens when we have less than 4 days of MTBF info.]</pre>
<p>Sources (other than those already mentioned in the text):</p>
<ul>
<li><a href="https://help.ubuntu.com/community/Tor">Tor &#8211; Community Ubuntu Documentation</a></li>
<li><a href="https://lists.torproject.org/pipermail/tor-relays/2011-February/000302.html">Ubuntu howto for CLI install of Tor relay?</a></li>
<li><a href="https://lists.torproject.org/pipermail/tor-relays/2010-December/000238.html">Torstatus: What does stable server mean?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notepad.patheticcockroach.com/2487/installing-and-controlling-a-tor-relay-on-linux-via-command-line-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A few more playing with LVM: creating, mounting and removing a partition</title>
		<link>http://notepad.patheticcockroach.com/2102/a-few-more-playing-with-lvm-creating-mounting-and-removing-a-partition/</link>
		<comments>http://notepad.patheticcockroach.com/2102/a-few-more-playing-with-lvm-creating-mounting-and-removing-a-partition/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 14:31:40 +0000</pubDate>
		<dc:creator>David Dernoncourt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://notepad.patheticcockroach.com/?p=2102</guid>
		<description><![CDATA[The way 1&#038;1 provide their &#8220;cloud&#8221; (btw, it looks like my feeling about this meaningless word was right, after all ) is really unusual to me and gives me quite a few things to learn about. That&#8217;s how half a year ago I posted about extending and shrinking LVM volumes. It however had an important [...]]]></description>
			<content:encoded><![CDATA[<p>The way 1&#038;1 provide their &#8220;cloud&#8221; (btw, it looks like my feeling about this meaningless word <a href="http://www.gnu.org/philosophy/words-to-avoid.html#CloudComputing">was right, after all</a> <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) is really unusual to me and gives me quite a few things to learn about. That&#8217;s how half a year ago I posted about <a href="http://notepad.patheticcockroach.com/1262/second-impressions-on-1and1-again-or-how-to-deal-with-lvm/">extending and shrinking LVM volumes</a>. It however had an important limitation: once the filesystem is extended, it&#8217;s in most cases not possible to shrink it, so you can forget about shrinking the volume unless you don&#8217;t mind losing the whole partition.<br />
My workaround for that was just to increase volume size on a strict need-more-space basis, which of course leads to quite a massive waste of unused space. A few days ago, I finally searched a way to implement a better solution: creating a new LVM partition. So with all the unused space we can create a temporary partition that we can use to store temporary stuff, and when we need to expand the production partitions, we can just erase the temp partition, expand the prod partitions, then create a new temp partition over the remaining space.</p>
<p>The steps are actually fairly simple:</p>
<ul>
<li>find out the name of your LVM volume(s) and group(s): <code>pvs</code></li>
<li>let&#8217;s say you have a group named &#8220;vg00&#8243; with 50 GiB free space, and we want to create a volume named &#8220;espace1&#8243; which would take all this space. First we check what volumes are already in that group: <code>lvdisplay /dev/vg00</code><br />
Then we create the &#8220;espace1&#8243; volume: <code>lvcreate -L50G -nespace1 vg00</code></li>
<li>now we format it, say, in ext3: <code>mkfs -t ext3 -m 0 -v /dev/vg00/espace1</code><br />
Note that the &#8220;-m 0&#8243; means that we claim back the 5% (&#8220;-m 5&#8243;) space usually reserved for root. This is good for a storage partition, but not a good idea for a system partition.</li>
<li>then we create the mounting point, for instance: <code>mkdir /home/espace1</code></li>
<li>and all we have to do now is to mount it: <code>mount -t ext3 /dev/vg00/espace1 /home/espace1</code></li>
</ul>
<p>That&#8217;s it, your new partition is ready. You can also check out the results using <code>df -h</code>. You&#8217;ll probably want to make sure it&#8217;s automatically mounted at boot time, too: for this just add a line in <code>/etc/fstab</code> (<code>nano /etc/fstab</code>). For instance here&#8217;s our fstab file (note the last line with our new partition):</p>
<pre>/dev/xvda1      /               ext3    defaults        1 1
/dev/xvda2      none            swap    sw
/dev/vg00/usr   /usr            xfs     defaults        0 2
/dev/vg00/var   /var            xfs     defaults        0 2
/dev/vg00/home  /home           xfs     defaults,usrquota       0 2
devpts          /dev/pts        devpts  gid=5,mode=620  0 0
none            /proc           proc    defaults        0 0
none            /tmp    tmpfs   defaults        0 0
/dev/vg00/espace1  /home/espace1    ext3   defaults     0 2</pre>
<p>Finally, to destroy it, you just need to unmount it first, so:<br />
<code>umount /dev/vg00/espace1</code> => unmount<br />
<code>lvremove /dev/vg00/espace1</code> => delete the volume</p>
<p>This time that&#8217;s all, the circle of life of the volume is complete <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Here are the sources I used, in the last one you&#8217;ll also find how to create the whole LVM thing, not just a volume within it like we did here:</p>
<ul>
<li><a href="http://www.ubuntux.org/edit-fstab-to-mount-partition-at-startup">Ubuntux &#8211; Edit fstab to mount partition at startup</a></li>
<li><a href="http://tldp.org/HOWTO/LVM-HOWTO/createlv.html">LVM How-to &#8211; 11.7. Creating a logical volume</a></li>
<li><a href="http://www.walkernews.net/2007/07/02/how-to-create-linux-lvm-in-3-minutes/">Walker News &#8211; How To Create Linux LVM In 3 Minutes</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notepad.patheticcockroach.com/2102/a-few-more-playing-with-lvm-creating-mounting-and-removing-a-partition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with &#8220;Apache (internal dummy connection)&#8221;</title>
		<link>http://notepad.patheticcockroach.com/2068/dealing-with-apache-internal-dummy-connection/</link>
		<comments>http://notepad.patheticcockroach.com/2068/dealing-with-apache-internal-dummy-connection/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 14:15:27 +0000</pubDate>
		<dc:creator>David Dernoncourt</dc:creator>
				<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://notepad.patheticcockroach.com/?p=2068</guid>
		<description><![CDATA[Today we had our first crash since we moved to the new server 7 months ago. Actually, the server wasn&#8217;t exactly crashed but it had come to a point where it was unresponsive enough to be unable to server HTTP pages (and to make it a pain to connect to SSH). I wasn&#8217;t really in [...]]]></description>
			<content:encoded><![CDATA[<p>Today we had our first crash since we moved to the new server 7 months ago. Actually, the server wasn&#8217;t exactly crashed but it had come to a point where it was unresponsive enough to be unable to server HTTP pages (and to make it a pain to connect to SSH). I wasn&#8217;t really in the mood so I didn&#8217;t take a screenshot, but top reported an impressive 90+ load average (NB: this server currently only has one core). Anyway, basically it seemed that the server was flooded with apache2 processes. Webmin reported a full use of our (massive <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) 1 GiB of RAM as well as almost full use of our (twice as massive) virtual memory. I thought maybe we were being DOSed, although I don&#8217;t really see who would want to do that at the moment. I first stopped Apache, which basically solved the problem. But before starting it again I had a look at the logs&#8230; and in <code>/var/log/apache2/access.log</code> I found a massive amount of those:</p>
<blockquote><p>127.0.0.1 &#8211; - [27/Jul/2011:09:55:22 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:23 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:24 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:52 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:54 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:55 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:56 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:55:58 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:56:05 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;<br />
127.0.0.1 &#8211; - [27/Jul/2011:09:56:06 +0200] &#8220;OPTIONS * HTTP/1.0&#8243; 200 136 &#8220;-&#8221; &#8220;Apache (internal dummy connection)&#8221;</p></blockquote>
<p>I remember we already had issues with these internal dummy things on the previous server, but because software there was getting old our response to the problem was just, well, to move to the new server with all updated software and stuff. This time I decided to try to deal with the problem for real.</p>
<p>After some quick searches, I found out that internal dummy connections are used to wake up child processes. I&#8217;m not sure how all this works, but the key point here is that in the end, sometimes those calls may hit some of your &#8220;real&#8221; pages, and may also corrupt their cached version. Long story short, the request may end up more CPU-demanding than it should. That problem seems to have been solved in Apache 2.2.6, but although we are running a much later version I thought it wouldn&#8217;t hurt to still apply the work-around. Basically, all you need to do is to make sure that the dummy connections get a 403 error. So, just 2 lines in your configuration files (NB: it requires mod_rewrite to be enabled) (<a href="http://inventivelabs.com.au/weblog/post/apache-s-internal-dummy-connection">source</a>):</p>
<blockquote><p>RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]<br />
RewriteRule .* &#8211; [F,L]</p></blockquote>
<p>And voilà, internal dummy connections should now be processed effortlessly. Don&#8217;t forget to apply configuration changes.</p>
<p>References (if you need more details you&#8217;ll find quite a few there):</p>
<ul>
<li><a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=41796">ASF Bugzilla &#8211; Bug 41796 &#8211; Internal Dummy Connection should process effortlessly</a></li>
<li><a href="http://inventivelabs.com.au/weblog/post/apache-s-internal-dummy-connection">Inventing Labs &#8211; Apache&#8217;s &#8216;internal dummy connection&#8217;</a></li>
<li><a href="http://wiki.apache.org/httpd/InternalDummyConnection">Httpd Wiki &#8211; InternalDummyConnection</a></li>
<li><a href="http://rackerhacker.com/2008/09/23/apache-22-internal-dummy-connection/">Racker Hacker &#8211; Apache 2.2: internal dummy connection</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notepad.patheticcockroach.com/2068/dealing-with-apache-internal-dummy-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSSH seeing double in Ubuntu 10.04 LTS? Dealing with the &#8220;motd issue&#8221;.</title>
		<link>http://notepad.patheticcockroach.com/1902/openssh-seeing-double-in-ubuntu-10-04-lts-dealing-with-the-motd-issue/</link>
		<comments>http://notepad.patheticcockroach.com/1902/openssh-seeing-double-in-ubuntu-10-04-lts-dealing-with-the-motd-issue/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 08:40:32 +0000</pubDate>
		<dc:creator>David Dernoncourt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://notepad.patheticcockroach.com/?p=1902</guid>
		<description><![CDATA[I&#8217;ve had that annoying issue for a while on this very server: after some update of Ubuntu 10.04, the SSH welcome message (with system load, disk usage, updates needed and everything) right after the log-in prompt became doubled. That was particularly a pain since the &#8220;duplicated&#8221; welcome screen was in fact static, always displaying outdated [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had that annoying issue for a while on this very server: after some update of Ubuntu 10.04, the SSH welcome message (with system load, disk usage, updates needed and everything) right after the log-in prompt became doubled. That was particularly a pain since the &#8220;duplicated&#8221; welcome screen was in fact static, always displaying outdated information, like that:</p>
<blockquote><p>Linux s15429750 2.6.32-25-generic-pae #45-Ubuntu SMP Sat Oct 16 21:01:33 UTC 2010 i686 GNU/Linux<br />
Ubuntu 10.04.2 LTS</p>
<p>Welcome to Ubuntu!<br />
 * Documentation:  https://help.ubuntu.com/</p>
<p>  System information as of Sat Jun 11 09:54:52 CEST 2011</p>
<p>  System load:    0.86               Processes:           109<br />
  Usage of /home: 84.6% of 12.99GB   Users logged in:     1<br />
  Memory usage:   42%                IP address for eth0: 82.165.148.117<br />
  Swap usage:     1%</p>
<p>  Graph this data and manage this system at https://landscape.canonical.com/</p>
<p>  6 packages can be updated.<br />
  3 updates are security updates.</p></blockquote>
<p>I eventually found out that this is due to some junk (some copy of the welcome message) making its way into <code>/etc/motd.tail</code>, which is shown at the end of the &#8220;real&#8221; welcome message. So just empty this file (or replace it with whatever content you wish) to get rid of the double message.</p>
<p>On a side note, you can modify what&#8217;s output by motd by editing the scripts in <code>/etc/update-motd.d</code>. A dirty way to disable it is to set those scripts as non-executable: <code>chmod -x *</code> but maybe add back the header to display kernel version: <code>chmod +x 00-header</code></p>
<p>Sources:</p>
<ul>
<li><a href="https://bugs.launchpad.net/ubuntu/+bug/660470">Bug #660470 in Ubuntu: “Double Welcome Screen since Upgrade from 10.04 to 10.10 server”</a></li>
<li><a href="http://ubuntuforums.org/archive/index.php/t-1470011.html">[ubuntu] Server 10.04: How to Eradicate the MOTD System? [Archive] &#8211; Ubuntu Forums</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notepad.patheticcockroach.com/1902/openssh-seeing-double-in-ubuntu-10-04-lts-dealing-with-the-motd-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Second impressions on 1and1 (again, or how to deal with LVM)</title>
		<link>http://notepad.patheticcockroach.com/1262/second-impressions-on-1and1-again-or-how-to-deal-with-lvm/</link>
		<comments>http://notepad.patheticcockroach.com/1262/second-impressions-on-1and1-again-or-how-to-deal-with-lvm/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 17:45:41 +0000</pubDate>
		<dc:creator>David Dernoncourt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://notepad.patheticcockroach.com/?p=1262</guid>
		<description><![CDATA[&#8220;mount: unknown filesystem type &#8216;LVM2_member&#8217;&#8221;&#8230; That&#8217;s the error message that eventually allowed me to find the solution. As I mentioned previously (twice already), when you rent a cloud server at 1and1, and you install Linux on it (well, at least Ubuntu), you obtain a weird partitioning scheme. Such as: # df -h Filesystem Size Used [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;mount: unknown filesystem type &#8216;LVM2_member&#8217;&#8221;</em>&#8230;<br />
That&#8217;s the error message that eventually allowed me to find the solution.</p>
<p>As I mentioned <a href="http://notepad.patheticcockroach.com/1257/second-impressions-on-1and1/">previously</a> (twice already), when you rent a cloud server at 1and1, and you install Linux on it (well, at least Ubuntu), you obtain a weird partitioning scheme. Such as:</p>
<pre># df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            3.7G  1.2G  2.6G  31% /
none                  490M  140K  490M   1% /dev
none                  500M  8.0K  500M   1% /dev/shm
none                  500M     0  500M   0% /tmp
none                  500M   60K  500M   1% /var/run
none                  500M     0  500M   0% /var/lock
none                  500M     0  500M   0% /lib/init/rw
/dev/mapper/vg00-usr  4.0G  441M  3.6G  11% /usr
/dev/mapper/vg00-var  4.0G  215M  3.8G   6% /var
/dev/mapper/vg00-home 4.0G  4.3M  4.0G   1% /home</pre>
<p>So, in total much less than the 100 GB you get in the smallest case. I tried to follow their (tiny) <a href="http://faq.1and1.fr/serveurs/serveur_cloud_dynamique/1.html">FAQ on the subject</a>, but seriously this wasn&#8217;t worth going farther than:</p>
<pre># fdisk -l

Disk /dev/xvda: 100.0 GB, 100000595968 bytes
255 heads, 63 sectors/track, 12157 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1               1         487     3911796   83  Linux
/dev/xvda2             488         731     1959930   82  Linux swap / Solaris
/dev/xvda3             732       12157    91779345   8e  Linux LVM</pre>
<p>(I&#8217;ll be trying to provide full output as I guess that&#8217;s what&#8217;s most helpful if you&#8217;re struggling to do just what I wanted to do, i.e. just get the GBs you paid for)<br />
I just tried to mount that big /dev/xvda3 thing, but it failed:</p>
<pre># cd mnt
# ls
# mkdir part1
# mount /dev/xvda3 /mnt/part1
mount: unknown filesystem type 'LVM2_member'</pre>
<p>But this error was not in vain, for searching for it brought me the solution: that thing is an <a href="http://en.wikipedia.org/wiki/Logical_volume_management">LVM volume</a>, and there&#8217;s a particular way to deal with it.<br />
First you can (should!) check out your LVM volumes *and groups*:</p>
<pre># pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/xvda3 vg00 lvm2 a-   87.52g 75.52g</pre>
<p>Here it&#8217;s simple, we have one volume, <em>/dev/xvda3</em>, which contains one group, <em>vg00</em>, which has a size of 87.52GiB (among which 75.52GiB unassigned aka free). Looks familiar? You bet, remember earlier:</p>
<pre>/dev/mapper/vg00-usr  4.0G  441M  3.6G  11% /usr
/dev/mapper/vg00-var  4.0G  215M  3.8G   6% /var
/dev/mapper/vg00-home 4.0G  4.3M  4.0G   1% /home</pre>
<p>Now you&#8217;ll want to check out what&#8217;s inside that group:</p>
<pre># lvdisplay /dev/vg00
  --- Logical volume ---
  LV Name                /dev/vg00/usr
  VG Name                vg00
  LV UUID                ElBhAu-r2PF-g1sV-UICK-T7Ao-TZmC-uKv0sj
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:0

  --- Logical volume ---
  LV Name                /dev/vg00/var
  VG Name                vg00
  LV UUID                gz0jhl-7uzG-1wqj-b1Ok-Mqjk-rWlC-ZHBBhy
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:1

  --- Logical volume ---
  LV Name                /dev/vg00/home
  VG Name                vg00
  LV UUID                2C9KvC-Dcmx-4C6N-T7cg-NzAr-WVOi-KS2xc1
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:2</pre>
<p>It&#8217;s like the jackpot, because from all the posts I read about LVM (see sources at the end), it seems that the hard part with those LVM volumes is to mount them. Here (on that 1and1 cloud server) we&#8217;re totally in luck: they&#8217;re already mounted! We just need to find out how to resize them, and this looks fairly easy: lvextend and lvreduce&#8230; Now, before going further, I&#8217;d like to warn you about something: extending is most likely totally harmless (and super-fast), reducing is probably more risky, or at least more tedious (you need to unmount the logical volume to do it &#8220;safely&#8221;, and I&#8217;m not sure how safe this is).<br />
So the winning strategy, in my opinion, is maybe to try extending an LVM with 1GiB just to see if it works fine, and then wait until you have a better idea of which volume needs space before extending them again (maybe also wait till that volume gets low on free space &#8211; but don&#8217;t wait too much, it would be stupid to lose data because of lack of assigned space while there&#8217;s so much free ^^). Avoid extending the volumes alternatively and regularly to avoid fragmenting them. Avoid assigning too much too fast to avoid having to reduce a volume later (you&#8217;ll see below how scary it sounds when you try it <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).<br />
So, here are the 2 commands and their outputs:</p>
<pre># lvextend -L+1G /dev/vg00/home
  Extending logical volume home to 5.00 GiB
  Logical volume home successfully resized</pre>
<pre># lvreduce -L-1G /dev/vg00/home
  WARNING: Reducing active and open logical volume to 4.00 GiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce home? [y/n]: n
  Logical volume home NOT reduced
  Command failed with status code 5.</pre>
<p>(yeah, I aborted that one ^^)</p>
<p>Now that you&#8217;ve extended the volume, you&#8217;ll have to extend the filesystem first. Something you should know before going on if you&#8217;re doing this on 1and1 like me: their cloud servers use XFS, and you can&#8217;t shrink an XFS file system so once you&#8217;ve expanded it there&#8217;s no easy way back. Here we go, for instance for /home (the LVM volume needs to be mounted):</p>
<pre># xfs_growfs /home
meta-data=/dev/mapper/vg00-home  isize=256    agcount=8, agsize=131072 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=1048576, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=65536  blocks=0, rtextents=0
data blocks changed from 1048576 to 1310720</pre>
<p>One last thing: let&#8217;s check how the free space lost the GiB we assigned:</p>
<pre># pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/xvda3 vg00 lvm2 a-   87.52g 74.52g</pre>
<p>And&#8230; back to the beginning:</p>
<pre># df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            3.7G  1.1G  2.7G  30% /
none                  490M  140K  490M   1% /dev
none                  500M     0  500M   0% /dev/shm
none                  500M     0  500M   0% /tmp
none                  500M   60K  500M   1% /var/run
none                  500M     0  500M   0% /var/lock
none                  500M     0  500M   0% /lib/init/rw
/dev/mapper/vg00-usr  4.0G  441M  3.6G  11% /usr
/dev/mapper/vg00-var  4.0G  216M  3.8G   6% /var
/dev/mapper/vg00-home 5.0G  4.4M  5.0G   1% /home</pre>
<p>Success! <img src='http://notepad.patheticcockroach.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Sources (I didn&#8217;t really use all of them, but they might be useful to dig deeper &#8211; I tried to put the most relevant ones at the top):</p>
<ul>
<li><a href="http://www.linuxquestions.org/questions/linux-hardware-18/mount-unknown-filesystem-type-lvm2_member-564880/">LinuxQuestions &#8211; mount: unknown filesystem type &#8216;LVM2_member&#8217;</a></li>
<li><a href="http://www.brandonhutchinson.com/Mounting_a_Linux_LVM_volume.html">Mounting a Linux LVM volume</a></li>
<li><a href="http://tldp.org/HOWTO/LVM-HOWTO/reducelv.html">LVM How-to: Reducing a logical volume</a></li>
<li><a href="http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html">LVM How-to: Extending a logical volume</a></li>
<li><a href="http://www.trueblade.com/knowledge/resizing-an-lvm-partition.html">Resizing an LVM partition, True Blade Systems, Inc.</a></li>
<li><a href="http://www.linux-sxs.org/storage/fedora2ubuntu.html">Accessing a Fedora Logical Volume from Ubuntu</a></li>
<li><a href="http://pissedoffadmins.com/?p=481">PissedOffAdmins &#8211; mount: unknown filesystem type ‘LVM2_member’</a></li>
<li><a href="http://www.fedoraforum.org/forum/archive/index.php/t-64964.html">How to mount LVM volumes, help!</a></li>
<li><a href="http://www.gnu.org/software/parted/manual/html_chapter/parted_7.html">LVM and RAID</a></li>
</ul>
<p>Update (15 Jan 2011): checking the queries bringing people here and reproducing them in Google, I was able to find a FAQ in the UK FAQ just about that&#8230; I really wonder why the heck the 1&#038;1 FAQ is so totally different from one country to another! Anyway, here&#8217;s the link: <a href="http://faq.1and1.co.uk/server/root_server/11.html">1&#038;1 Webhosting FAQ | How can I increase a logical volume?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://notepad.patheticcockroach.com/1262/second-impressions-on-1and1-again-or-how-to-deal-with-lvm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

