<?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>atc &#187; debian</title>
	<atom:link href="http://blog.beplacid.net/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.beplacid.net</link>
	<description>Musings of technology, sport, life et al</description>
	<lastBuildDate>Thu, 10 Jun 2010 10:24:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu Intrepid Ibex/8.10 Is Ruining My Hardware</title>
		<link>http://blog.beplacid.net/2008/11/09/ubuntu-intrepid-ibex810-is-ruining-my-hardware/</link>
		<comments>http://blog.beplacid.net/2008/11/09/ubuntu-intrepid-ibex810-is-ruining-my-hardware/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 18:44:33 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ibm]]></category>
		<category><![CDATA[thinkpad 31]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/2008/11/09/ubuntu-intrepid-ibex810-is-ruining-my-hardware/</guid>
		<description><![CDATA[I&#8217;m a long time user, advocate and all-round fan of Linux. In particular, I&#8217;ve used Debian or variant distributions and have never had any major issues (well none that weren&#8217;t PEBKAC). I&#8217;ve been running Debian Sid on my Thinkpad X31 for around three years now, and out of curiosity I thought I&#8217;d try out Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a long time user, advocate and all-round fan of Linux. In particular, I&#8217;ve used Debian or variant distributions and have never had any major issues (well none that weren&#8217;t PEBKAC). I&#8217;ve been running Debian Sid on my Thinkpad X31 for around three years now, and out of curiosity I thought I&#8217;d try out Ubuntu Intrepid Ibex for good measure &#8211; it&#8217;s apparently a very good update. Having also been using Ubuntu on-and-off on my various laptops over the years (since &#8216;Warty&#8217; &#8211; version 4.10), I knew I had to expect the best.</p>
<p>I docked myself at my <a href="http://wiki.beplacid.net/articles/My_New_PC" title="My New PC" target="_blank">Workstation</a> and started downloading an ISO. Once finished, I burnt it and rebooted my Thinkpad. One of the great things about Ubuntu&#8217;s installation (which has existed for a while) is the Live CD &#8211; you get to boot into Ubuntu without having to install anything. It works well and is a great feature for new users who aren&#8217;t sure what they&#8217;re doing, or whether they want to risk installing Linux. What&#8217;s great is that the hardware issues of old are long gone: . Unforunately I found the boot-up process to be volatile: it was taking a long time and things didn&#8217;t look great. I eventually got into X and played around. Amazingly I had all my Thinkpad buttons working; suspend, hibernate (suspend-to-disk) and even the back &amp; forward buttons for the browser. It worked flawlessly.</p>
<p>Naturally I decided to install as I was very impressed. So I fire up the installation procedure by clicking &#8216;Install&#8217; on the Live CD&#8217;s desktop and go through the motions. Clicking &#8216;Forward&#8217; after the username setup freezes, and my laptop performs a hard-shutdown&#8230;WTF?? I try again &#8211; the same thing happens. What&#8217;s going on? I decided to get an alternate ISO and try that. Thankfully it installed, but I was a little concerned that nothing was going to work&#8230;</p>
<p>After finally booting into X after my little ordeal, I decide to run `apt-get update &amp;&amp; apt-get upgrade` in a shell. To my surprise, as soon as it starts upgrading packages (a Kernel upgrade) my shell gets spammed with &#8220;The system is going down for a reboot NOW!&#8221; and Ubuntu shuts down. Ouch. This isn&#8217;t good.</p>
<p>I&#8217;ve had overheating issues in the past, but this is beginning to worry me. Anything even remotely CPU intensive (scrolling the wireless network list, apt-get upgrade, etc etc)  causes Ubuntu to force shutdown, and I&#8217;m left looking very cross at my X31.</p>
<p>Some googling produces thread after thread on the Ubuntu forums about this, but things seem to be getting ignored. There&#8217;s no issues, and people are talking about the exact same problems in Gutsy and Feisty &#8211; that&#8217;s three or more major releases ago. I&#8217;ve tried these things:</p>
<ul>
<li>Adding the following to /etc/rc.local:
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 50px; text-align: left">echo -n “90:80:60:75:70:65″ &gt; /proc/acpi/thermal_zone/THM0/trip_points
echo 2 &gt; /proc/acpi/thermal_zone/THM0/polling_frequency</pre>
</li>
</ul>
<ul>
<li> Appending these modules to /etc/modules:<br />
battery<br />
ac<br />
thermal<br />
processor<br />
acpi-cpufreq<br />
cpufreq-userspace</li>
</ul>
<p>No luck. Furthermore, with each futile attempt, I get hard-rebooted or even worse: no init 0, just a hard shutdown. It&#8217;s frustrating and furthermore it is <strong>very likely that this is damaging my hardware</strong>. I&#8217;ve been monitoring `acpi -t` output, top and more but nothing&#8217;s helping. Even running /etc/init.d/gdm stop and trying the apt-get upgrade in a shell doesn&#8217;t help: same old hard shutdown.</p>
<p>I don&#8217;t know what to do. I&#8217;m a big fan of Ubuntu as it&#8217;s bringing Linux to the masses, but I can&#8217;t keep doing this to my poor old Thinkpad X31 &#8211; it won&#8217;t last much longer.</p>
<p>Anyone out there have any ideas?</p>
<p><strong>Update:</strong> I&#8217;ve filed a bug report <a href="https://bugs.launchpad.net/ubuntu/+bug/296056" title="Ubuntu Bug Report" target="_blank">here</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2008%2F11%2F09%2Fubuntu-intrepid-ibex810-is-ruining-my-hardware%2F';
  addthis_title  = 'Ubuntu+Intrepid+Ibex%2F8.10+Is+Ruining+My+Hardware';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2008/11/09/ubuntu-intrepid-ibex810-is-ruining-my-hardware/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Server Benchmarking Diary &#8211; Debian, Apache 2 and MySQL</title>
		<link>http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/</link>
		<comments>http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 20:32:16 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/</guid>
		<description><![CDATA[This blog took nearly 7 thousand hits yesterday. At its peak, it took 1.8 thousand an hour. That&#8217;s a decent amount of traffic. This was all brought about when I submitted a link to reddit.com regarding a way to crash Google Chrome instantly. Coincidentally, I had spent an hour or so the night before testing [...]]]></description>
			<content:encoded><![CDATA[<p>This blog took nearly 7 thousand hits yesterday. At its peak, it took 1.8 thousand an hour. That&#8217;s a decent amount of traffic. This was all brought about when I submitted a link to <a href="http://reddit.com" title="Reddit ">reddit.com</a> regarding <a href="http://blog.beplacid.net/2008/09/04/tasty-google-chrome-bug-so-much-for-isolated-tabsprocesses/" title="Google Chrome - so much for isolated tabs">a way to crash Google Chrome instantly</a>. Coincidentally, I had spent an hour or so the night before testing the stability of my <a href="http://slicehost.com" title="Slicehost Xen Hosting">Slicehost</a> Xen virtual machine (more info <a href="http://blog.beplacid.net/2008/09/04/tasty-google-chrome-bug-so-much-for-isolated-tabsprocesses/" title="Slicehost migration">here</a>) just out of curiosity. I was using <em>wget</em>, <em>ab</em> (Apache benchmarking tool) and <em>htop</em> to mirror, send concurrent requests and monitor respectively. I&#8217;m going to document my findings here.</p>
<h3>What I&#8217;m Running</h3>
<p>Here&#8217;s a rundown of what sites I&#8217;m running and the software used.</p>
<ul>
<li><a href="http://beplacid.net">beplacid.net</a> &#8211; Apache 2, Django (Python framework), MySQL (one instance)</li>
<li>blog.beplacid.net &#8211; PHP 5, MySQL, Wordpress</li>
<li><a href="http://readingcamra.org.uk">readingcamra.org.uk</a> &#8211; Apache Tomcat 6, Java 5, MySQL</li>
<li><a href="http://readingbeerfestival.org.uk" title="Reading Beer Festival website">readingbeerfestival.org.uk</a> &#8211; As above</li>
</ul>
<h3>Wget &#8211; the Swiss army knife of HTTP command line tools</h3>
<p>Wget&#8217;s one of those tools you really take for granted. It&#8217;s versatile, reliable, simple and most importantly &#8211; it does its job very well. One of its nicest features is the <em>&#8211;mirror</em> option. This allows you to&#8230;mirror a given website. I initially thought of running multiple instances of wget at the same time. I started small at first: one instance running to mirror the entire <a href="http://beplacid.net" title="beplacid.net">site</a>. I ran the following in a shell:</p>
<blockquote><p>alex@prometheus:/tmp$ wget &#8211;mirror beplacid.net/</p></blockquote>
<p>It&#8217;s simple: mirror beplacid.net. Watching the processes and CPU usage on the server, it became apparent that  this wasn&#8217;t going to do much. The CPU usage didn&#8217;t exceed 5% on its first core. I had to rethink. Then <em>ab</em> sprung to mind.</p>
<h3>ab &#8211; Apache benchmarking tool</h3>
<p>This is another useful tool. It&#8217;s simple to use and allows you to quickly and easily hit a given hostname with HTTP requests, all tailored to your specific needs. To do all this, however, you need to be running as root. A noble security measure.</p>
<p>I wanted to generate some traffic that would put the server under some strain, so I started with 50 requests and 5 at a time:</p>
<blockquote><p>prometheus:/root$ ab -n 50 -c 5 beplacid.net/</p></blockquote>
<p>Now things started to get fun. This peaked CPU usage to 94% on one core, the others were between 60 and 80. I was starting to see some real stats. I doubled things &#8211; 100 with 10 per request:</p>
<blockquote><p> prometheus:/root$ ab -n 100 -c 10 beplacid.net/</p></blockquote>
<p>This was a little more representative of a heavy amount of traffic. Perhaps akin to slashdot or a reddit. Put simply, that&#8217;s 100 requests with 10 each sent each time. Still nothing major, so I went all out:</p>
<blockquote><p>Concurrency Level:      10<br />
Complete requests:      1000<br />
Total transferred:      4856792 bytes<br />
HTML transferred:       4687792 bytes<br />
Requests per second:    4.99 [#/sec] (mean)<br />
Time per request:       2002.453 [ms] (mean)<br />
Time per request:       200.245 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          23.69 [Kbytes/sec] received</p></blockquote>
<p>To summarise, the server took 1000 requests with an average of 5 per second, each returning just over 2 seconds. Not bad, considering what I&#8217;m running.</p>
<p>I&#8217;m pleased with my setup. It can take a punch and it&#8217;s still running. My next task is to hit both beplacid.net and the blog, with perhaps some traffic mirroring readingbeerfestival.org.uk too.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2008%2F09%2F05%2Fserver-benchmarking-tips-debian%2F';
  addthis_title  = 'Server+Benchmarking+Diary+%26%238211%3B+Debian%2C+Apache+2+and+MySQL';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Debian &amp; Ubuntu &#8211; SSH Via an HTTP Proxy</title>
		<link>http://blog.beplacid.net/2008/06/10/debian-ubuntu-ssh-via-an-http-proxy/</link>
		<comments>http://blog.beplacid.net/2008/06/10/debian-ubuntu-ssh-via-an-http-proxy/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 08:21:42 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[corkscrew]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunelling]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/2008/06/10/debian-ubuntu-ssh-via-an-http-proxy/</guid>
		<description><![CDATA[So you&#8217;re sitting at work, and your much-loved VPS with hosting company X has gone down. You need to bring it back up, but you&#8217;re an hour away from getting to a PC.
Fear not, fellow hacker &#8211; SSH over an HTTP proxy is here! Well actually, it&#8217;s been here a while. Ahem.
Before you do this, [...]]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;re sitting at work, and your much-loved VPS with hosting company X has gone down. You need to bring it back up, but you&#8217;re an hour away from getting to a PC.</p>
<p>Fear not, fellow hacker &#8211; SSH over an HTTP proxy is here! Well actually, it&#8217;s been here a while. Ahem.</p>
<p>Before you do this, I must stress that you should check with your network&#8217;s usage policy before continuing. You may be breaking your networks rules, and <strong>I cannot &amp; will not be held responsible for anything that arrises from using these instructions. You are on your own</strong>.</p>
<h3>Installing Corkscrew</h3>
<p>To quote its package details in Debian &amp; Ubuntu repositories, Corkscrew &#8220;<em>is a simple tool to tunnel TCP connections through an HTTP proxy supporting the CONNECT method. It reads stdin and writes to stdout during the connection, just like netcat</em>&#8220;. Put simply, it&#8217;s a way of sending traffic that would normally go via alternate means (say, over port 22), through a proxy server that may block the original routes.</p>
<p>We&#8217;ll need corkscrew, or a similar TCP tunnel package, to send the info via the proxy. Fire up a shell and execute the following:</p>
<p><code>sudo apt-get install corkscrew</code></p>
<p>This will install corkscrew. Don&#8217;t worry, it doesn&#8217;t run as a daemon, but instead on a per-connection basis (that is, it reads from stdin), so it&#8217;s not going to hog many resources. Once that&#8217;s done, we&#8217;ll configure ssh to use corkscrew instead of a direct connection.</p>
<p>If your HTTP proxy uses authentication, then you&#8217;ll need to tell it about the username and password to use. This is where the concept of &#8216;auth-file&#8217; comes into play. All you have to do is put your username &amp; password, separated by a colon, into a textfile. Once you&#8217;ve done this, you just have to tell corkscrew where to find the auth-file. Create a file called .corkscrew-auth in your home directory and place your username and password in the following format:</p>
<p><code>username:password</code></p>
<p>Save the file and get ready for the next bit&#8230; :)</p>
<h3>Configuring &#8217;ssh&#8217; For Tunneling</h3>
<p>Now we&#8217;ll tell ssh what to do when connecting to all or specific hosts. Open up ~/.ssh/config (that&#8217;s /home/yourusername/.ssh/config) in your favourite text editor (vim &gt; *) and add the following lines:</p>
<p><code>Host *<br />
ProxyCommand corkscrew proxyhostname proxyport %h %p /home/username/.corkscrew-auth</code></p>
<p><strong>Note:</strong> replace proxyhostname and proxyport with the equivalents for your network.</p>
<p><strong>Note:</strong> you won&#8217;t need to add the last section, &#8216;/home/username/.corkscrew-auth&#8217;, if your HTTP proxy doesn&#8217;t use authentication.</p>
<p>What we&#8217;ve just told ssh to do is for all hostnames (&#8216;Host *&#8217;), use the following proxy command to route the connection. The text after ProxyCommand is all specific to your HTTP tunneling software, except %h and %p which are ssh config variables for the hostname and port respectively.</p>
<p>This should work out of the box. It did so for me. Test it out in a shell by doing the following:</p>
<p><code>ssh somehost.com</code></p>
<p>I think you&#8217;ll be pleasantly surprised&#8230;Any issues, please post below and I&#8217;ll be happy to help out.</p>
<p>Cheers for reading,</p>
<p>Placid</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2008%2F06%2F10%2Fdebian-ubuntu-ssh-via-an-http-proxy%2F';
  addthis_title  = 'Debian+%26%23038%3B+Ubuntu+%26%238211%3B+SSH+Via+an+HTTP+Proxy';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2008/06/10/debian-ubuntu-ssh-via-an-http-proxy/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HOWTO: Apache 2, Tomcat 5.5.25 and mod_jk and Debian</title>
		<link>http://blog.beplacid.net/2007/11/20/howto-apache-2-tomcat-5525-and-mod_jk-under-debian/</link>
		<comments>http://blog.beplacid.net/2007/11/20/howto-apache-2-tomcat-5525-and-mod_jk-under-debian/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 10:58:12 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/2007/11/20/howto-apache-2-tomcat-5525-and-mod_jk-under-debian/</guid>
		<description><![CDATA[Update: It&#8217;s been said that this howto will also work for Tomcat 6. I&#8217;ve not tested it, but I&#8217;d assume it would work considering the manual aspects of the installation and the unlikely event that Tomcat 6 would&#8217;ve changed its directory structure considerably. If you find evidence to the contrary, please let me know.
Introduction
This HowTo [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold"><span style="text-decoration: underline">Update:</span> </span>It&#8217;s been said that this howto will also work for Tomcat 6. I&#8217;ve not tested it, but I&#8217;d assume it would work considering the manual aspects of the installation and the unlikely event that Tomcat 6 would&#8217;ve changed its directory structure considerably. If you find evidence to the contrary, please let me know.</p>
<p><span style="font-weight: bold">Introduction</span><br />
This HowTo explains the installation and configuration of Apache 2.2.3, Tomcat 5.5.25 and the Apache Jakarta module &#8212; a connector/proxy for Apache &amp; Tomcat &#8212; under Debian Etch. It is geared towards those who already have experience configuring Apache and Tomcat and are aware of the basic principles behind Apache modules.</p>
<p><span style="font-weight: bold">Prerequisites</span><br />
A working installation of Debian GNU/Linux that has an internet connection, or valid CD-ROM apt packages disc.</p>
<p><span style="font-weight: bold">Step 1: Installing Apache</span><br />
If you don&#8217;t already have Apache installed, you will need to run the following in a shell as root:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">apt-get install apache2</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>This will install Apache 2 and any relevant dependencies. Configuration files for Apache can be found under /etc/apache2, and host-specific configuration are found under /etc/apache2/sites-available/. This is where you should configure your individual Virtual Hosts, as opposed to placing the configuration in /etc/apache2/apache2.conf.</p>
<p><span style="font-weight: bold">Step 2: Install mod_jk</span><br />
Using apt, you need to install the Apache Jakarta module by executing the following in a shell as root:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">apt-get install libapache2-mod-jk</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>The module may need enabling via &#8216;a2enmod jk&#8217;, but it is not necessary at this time. Go ahead and execute the following as root:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">a2enmod jk</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>Running the above should return a message similar to &#8216;Module enabled, now run /etc/init.d/apache2 force-reload&#8217;. I do not recommend reloading Apache&#8217;s configuration until everything has been installed and setup. This will ensure Apache remains usable while you setup Tomcat in the next step.</p>
<p><span style="font-weight: bold">Step 3: Download and Extract Apache Tomcat 5.5.25</span><br />
There&#8217;s a reason I installed Tomcat manually: Debian&#8217;s Tomcat package is a mess. The default package splits, amongst others, the webapps and conf folders. Whilst the conf folder is situated in a respectable location (/etc/tomcat5), the webapps directory is symlink&#8217;d under /var/, which tends to cause problems with Apache-&gt;Tomcat configuration. Therfore, I have chosen to manually install Tomcat using the .tar.gz from tomcat.apache.org; as well as this being a recommendation from various people in the #tomcat channel on irc.freenode.net. In short, it&#8217;s a configuration and administration nightmare.</p>
<p>Download Apache Tomcat 5.5.25 from here: <a href="http://tomcat.apache.org/download-55.cgi" target="_blank">http://tomcat.apache.org/download-55.cgi</a> (select a mirror) and extract it to <span style="font-weight: bold">one</span> of the following locations (I used /usr/share/):</p>
<ul>
<li> /usr/local/</li>
<li> /usr/share/</li>
</ul>
<p>To do the above, execute these commands as root:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">mv apache-tomcat-5.5.25.tar.gz /usr/share/; cd /usr/share<br />
tar zxvf apache-tomcat-5.5.25.tar.gz; mv apache-tomcat-5.5.25 tomcat-5.5.25</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>Now, let&#8217;s setup a user and group so we can provide safe permission control over the conf and webapps directories.</p>
<p><span style="font-weight: bold">Step 4: Add a tomcat user and group</span></p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">adduser tomcat &amp;&amp; addgroup tomcat; cd /usr/share/tomcat-5.5.25</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>We&#8217;ve just created the tomcat user &amp; group, so let&#8217;s apply the ownership permissions to the webapps directory:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">chown -R tomcat:tomcat webapps; chmod -R 775 webapps</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>This now means that any user who&#8217;s in the tomcat group can read, write and execute files under the webapps directory.</p>
<p><span style="font-style: italic">Note: if you use a specific user and group such as www-data for Apache ownership and execution, which is the default in Debian, you will need to add &#8216;tomcat&#8217; to the www-data user&#8217;s groups:</span></p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">usermod -aG tomcat www-data</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>The following is optional, as it sets the group permissions of the server.xml to writable by the tomcat group. This may not be what you want, so be careful!</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">cd conf; chmod g+w server.xml</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>Now that we&#8217;ve setup the most important directories, let&#8217;s make the tomcat startup and shutdown bash scripts executable, ready for starting it up:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">cd /usr/share/tomcat-5.5.25/bin/; chmod 755 shutdown.sh startup.sh</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p><span style="font-weight: bold">Step 4: Create the workers.properties File</span><br />
Create the following file, as root, under /etc/apache2 or a directory of your choice (/usr/share/tomcat-5.5.25/conf would also be fine), but make sure it&#8217;s readable by the tomcat user and/or group.</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>File:</strong></span></td>
</tr>
<tr>
<td class="quote">#<br />
# This file provides minimal jk configuration properties needed to<br />
# connect to Tomcat.<br />
#<br />
# We define a worker named &#8216;default&#8217;<br />
#workers.tomcat_home=/usr/share/tomcat5.5/<br />
workers.java_home=/usr/lib/jvm/java-1.5.0-sun/<br />
ps=/<br />
worker.list=default<br />
worker.default.port=8009<br />
worker.default.host=localhost<br />
worker.default.type=ajp13<br />
worker.default.lbfactor=1</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>The &#8216;worker.list&#8217; parameter defines the names for the ajp13 connector(s). This is what Apache talks to. You can specify a name of your choice, but make sure you remember it for later, and ensure you&#8217;ve changed all parameters beginning with &#8216;worker.default&#8217; to the name you&#8217;ve set.</p>
<p><span style="font-weight: bold">Step 5: Configure an Apache to Talk To Tomcat and add a Virtual Host</span><br />
This step is the most important part. It assumes that you&#8217;re using virtual hosts for Apache (you may not be), so if that isn&#8217;t the case, just place the JkMount configuration lines in the Virtual Host section along with the config. below in your main apache file (/etc/apache2/apache2.conf).</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>File:</strong></span></td>
</tr>
<tr>
<td class="code"># mod_jk config<br />
# Where to find workers.properties<br />
JkWorkersFile /etc/apache2/workers.properties# Where to put jk logs<br />
JkLogFile     /var/log/apache2/jk.log# Set the jk log level [debug/error/info]<br />
JkLogLevel info# Select the log format<br />
JkLogStampFormat &#8220;[%a %b %d %H:%M:%S %Y] &#8220;#JkOptions indicate to send SSL KEY SIZE,<br />
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories# JkRequestLogFormat set the request format<br />
JkRequestLogFormat &#8220;%w %V %T&#8221;</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>For my virtual host, I created the following configuration file under /etc/apache2/sites-available:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>File:</strong></span></td>
</tr>
<tr>
<td class="code">&lt;VirtualHost *:80&gt;<br />
ServerName abc.myhost.com<br />
ServerAdmin <a href="mailto:webmaster@abc.myhost.com">webmaster@abc.myhost.com</a><br />
JkMount /* default<br />
JkMount /*.jsp default<br />
DirectoryIndex index.jsp index.html<br />
# Globally deny access to the WEB-INF directory<br />
&lt;LocationMatch &#8216;.*WEB-INF.*&#8217;&gt;<br />
AllowOverride None<br />
deny from all<br />
&lt;/LocationMatch&gt;<br />
&lt;/VirtualHost&gt;</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>The most important lines in the above quote are the following:</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">JkMount /* default<br />
JkMount /*.jsp default</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p>These two lines specify the URL paths that should be handed to mod_jk and thus Tomcat. The &#8216;default&#8217; section of the line specifies the JK worker identifier. <span style="font-weight: bold">This <span style="text-decoration: underline">must</span> match the name you specified in the workers.properties file!</span></p>
<p>That&#8217;s the configuration done, let&#8217;s fire this baby up!</p>
<p><span style="font-weight: bold">Step 5: Unleashing the Beast; Starting Apache &amp; Tomcat</span><br />
To ensure a clean start up, I recommend stopping Apache entirely, and then starting up Tomcat, then Apache. Do so by executing the following commands (as root, see the note blow otherwise)::</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Shell:</strong></span></td>
</tr>
<tr>
<td class="code">/etc/init.d/apache2 stop<br />
/usr/share/tomcat-5.5.25/bin/startup.sh<br />
/etc/init.d/apache2 start</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<p><span style="font-style: italic">Note: if you want tomcat to run as a separate user but keep ownership as root, use jsvc and the -user flag to specify the user it should change to at startup.</span></p>
<p>Both Tomcat and Apache should startup without error, and you should now be able to connect to Apache and the Tomcat via the specified Virtual Host.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2007%2F11%2F20%2Fhowto-apache-2-tomcat-5525-and-mod_jk-under-debian%2F';
  addthis_title  = 'HOWTO%3A+Apache+2%2C+Tomcat+5.5.25+and+mod_jk+and+Debian';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2007/11/20/howto-apache-2-tomcat-5525-and-mod_jk-under-debian/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
