<?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>RussTaylor &#187; Apache</title>
	<atom:link href="http://russtaylor.co.uk/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://russtaylor.co.uk</link>
	<description>Things I&#039;ve done, seen, or thought about ...</description>
	<lastBuildDate>Thu, 05 Aug 2010 13:27:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Install MySQL 4.0.27 on&#160;Debian</title>
		<link>http://russtaylor.co.uk/2008/08/install-mysql-4027-on-debian/</link>
		<comments>http://russtaylor.co.uk/2008/08/install-mysql-4027-on-debian/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 15:19:44 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHPMyAdmin]]></category>

		<guid isPermaLink="false">http://russtaylor.co.uk/?p=59</guid>
		<description><![CDATA[Ok, I needed a specific version to run on our Debian server. This wasn&#8217;t part of the Debian packages. I tried using http://dev.mysql.com/doc/refman/5.0/en/installing-binary.html but I had a big fight with this; so thought I&#8217;d write my own guide. Grab the tar.gz file for the version you need, for example I used mysql-4.0.27.tar.gz which I found [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I needed a specific version to run on our Debian server. This wasn&#8217;t part of the Debian packages. I tried using http://dev.mysql.com/doc/refman/5.0/en/installing-binary.html but I had a big fight with this; so thought I&#8217;d write my own guide.</p>
<ol>
<li>Grab the tar.gz file for the version you need, for example I used mysql-4.0.27.tar.gz which I found on an old mirror using google. Starting from the root folder
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># wget http://www.sfr-fresh.com/unix/misc/mysql-4.0.27.tar.gz -P /usr/local/src/</span></div>
</li>
</ol>
</div>
<p>This saved the version I needed in /usr/local/src/</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># tar -xvvzf /usr/local/src/mysql-4.0.27.tar.gz -C /usr/local/src/ ; rm /usr/local/src/mysql-4.0.27.tar.gz</span></div>
</li>
</ol>
</div>
<p>This extracts the folder into /usr/local/src then deletes the original archive.</li>
<li>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># cd /usr/local/src/mysql-4.0.27</span></div>
</li>
</ol>
</div>
</li>
<li>I ran ./configure, and got the error
<div class="geshi no text">
<ol>
<li class="li1">
<div class="de1">checking for termcap functions library&#8230; configure: error: No curses/termcap library found</div>
</li>
</ol>
</div>
<p>To overcome this (<a href="http://bugs.mysql.com/bug.php?id=1279">I read this guide and</a>) I had to run configure using the &#8211;with-named-curses-lib flag, pointing to my libncurses library, e.g.<strong> ./configure &#8211;with-named-curses-libs=/lib/libncurses.so.5</strong>. That worked, but then gave me all sorts of grief later. Having read <a href="http://bugs.mysql.com/bug.php?id=1279">this guide</a> I found I should suffix ./configure with &#8211;prefix=/usr/local/mysql, so you should run<strong>./configure &#8211;with-named-curses-libs=/lib/libncurses.so.5 &#8211;prefix=/usr/local/mysql</strong></li>
<li>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># make</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># make install</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># ./scripts/mysql_install_db</span></div>
</li>
</ol>
</div>
</li>
<li>That completes the installation, but when I ran mysqld_safe to start the server I got
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>bin<span class="co0"># mysqld_safe</span></div>
</li>
<li class="li1">
<div class="de1">Starting mysqld daemon with databases from <span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>var</div>
</li>
<li class="li1">
<div class="de1">STOPPING server from pid <span class="kw2">file</span> <span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>var<span class="sy0">/</span>debianbox.pid</div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">080807</span> <span class="nu0">15</span>:<span class="nu0">54</span>:<span class="nu0">36</span>  mysqld ended</div>
</li>
</ol>
</div>
<p>To understand why it was failing I needed to find the log file. I did this by running find . -name *.err from the root folder. The mysql error log file was called /usr/local/var/debianbox.err (debianbox is my machine name). This said</p>
<div class="geshi no text">
<ol>
<li class="li1">
<div class="de1">080807 18:45:09 mysqld started</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:09 InnoDB: Started</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:09 /usr/local/libexec/mysqld: Can&#39;t find file: &#39;./mysql/host.frm&#39; (errno: 13)</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:09 Fatal error: Can&#39;t open privilege tables: Can&#39;t find file: &#39;./mysql/host.frm&#39; (errno: 13)</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:09 Aborting</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:09 InnoDB: Starting shutdown&#8230;</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:11 InnoDB: Shutdown completed</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:11 /usr/local/libexec/mysqld: Shutdown Complete</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">080807 18:45:11 mysqld ended</div>
</li>
</ol>
</div>
</li>
<li>Firstly I checked the file host.frm existed
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># find / -name host.frm</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql<span class="sy0">/</span>host.frm</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>var<span class="sy0">/</span>mysql<span class="sy0">/</span>host.frm</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>mysql<span class="sy0">/</span>var<span class="sy0">/</span>mysql<span class="sy0">/</span>host.frm</div>
</li>
</ol>
</div>
</li>
<li>errno: 13 is a permissions error. Next you need to add the mysql user and groups to the list of permissions as per the following
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># groupadd mysql</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># useradd -g mysql mysql</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># chown -R root /usr/local/mysql</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># chown -R mysql /usr/local/mysql/var</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># chgrp -R mysql /usr/local/mysql</span></div>
</li>
</ol>
</div>
</li>
<li>That didn&#8217;t appear to help me at all, my problem was I was running mysqld_safe from the wrong location, so the relative link to ./mysql/host.frm was wrong.
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># cd /usr/local/mysql/bin</span></div>
</li>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># ./mysqld_safe &#8211;user=mysql &amp;amp;</span></div>
</li>
</ol>
</div>
<p>Tada! I could then use the mysql client to connect and &#8216;show databases;&#8217; produced an output.</li>
<li>Next up my phpmyadmin install, and anything using mysql through errors.
<div class="geshi no html4strict">
<ol>
<li class="li1">
<div class="de1">Warning: mysql_connect() [function.mysql-connect]: Can&#39;t connect to local MySQL server through socket &#39;/var/run/mysqld/mysqld.sock&#39; (2) in /myscript.php on line 4</div>
</li>
<li class="li1">
<div class="de1">ERROR: Unable to connect to database server: Can&#39;t connect to local MySQL server through socket &#39;/var/run/mysqld/mysqld.sock&#39; (2)</div>
</li>
</ol>
</div>
<p>and when viewing phpmyadmin</p>
<div class="geshi no html4strict">
<ol>
<li class="li1">
<div class="de1">phpMyAdmin &#8211; error</div>
</li>
<li class="li1">
<div class="de1">#2002 &#8211; The server is not responding (or the local MySQL server&#39;s socket is not correctly configured)</div>
</li>
</ol>
</div>
<p>The problem was that because I specified prefix when configuring my mysql install the default locations that apache looks in for mysql where all wrong. I found my sock file like this</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">debianbox:<span class="sy0">/</span><span class="co0"># find / -name *.sock</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>cups<span class="sy0">/</span>cups.sock</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>tmp<span class="sy0">/</span>mysql.sock</div>
</li>
</ol>
</div>
<p>Then edited my php.ini file on the line</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw3">mysql</span><span class="sy0">.</span>default_socket <span class="sy0">=</span></div>
</li>
</ol>
</div>
<p>to</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw3">mysql</span><span class="sy0">.</span>default_socket <span class="sy0">=</span> <span class="sy0">/</span>tmp<span class="sy0">/</span><span class="kw3">mysql</span><span class="sy0">.</span>sock</div>
</li>
</ol>
</div>
<p>restarted apache, and everything (so far) works great!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://russtaylor.co.uk/2008/08/install-mysql-4027-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set up a Debian box with&#160;SSH/Apache/MySql/PHP/</title>
		<link>http://russtaylor.co.uk/2008/08/how-to-set-up-a-debian-box-with-sshapachemysqlphp/</link>
		<comments>http://russtaylor.co.uk/2008/08/how-to-set-up-a-debian-box-with-sshapachemysqlphp/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 15:41:45 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://russtaylor.co.uk/?p=51</guid>
		<description><![CDATA[I found a nice guide from Mark Shrader on how to set up a Debian box with a bunch of web hosting software. http://markshrader.wordpress.com/2007/10/14/step-by-step-debian-webserver/ I actually dodged using VMWare (or Virtual PC 2007, my personal preference) and installed it on a fresh server.  To do that I just downloaded CD 1 of the Debian cd [...]]]></description>
			<content:encoded><![CDATA[<p>I found a nice guide from Mark Shrader on how to set up a Debian box with a bunch of web hosting software.</p>
<p><a href="http://markshrader.wordpress.com/2007/10/14/step-by-step-debian-webserver/">http://markshrader.wordpress.com/2007/10/14/step-by-step-debian-webserver/</a></p>
<p>I actually dodged using VMWare (or Virtual PC 2007, my personal preference) and installed it on a fresh server.  To do that I just downloaded CD 1 of the Debian cd install sets (NOT the network install CD) and ran that, then used the net to download the remaining packages I needed.</p>
<p>NB: Just remember the packages in the setup (e.g. wget http://apache.rmplc.co.uk/httpd/httpd-<strong>2.2.4</strong>.tar.gz) are mostly out of date, so you&#8217;ll need to adjust accordingly (I used wget http://apache.rmplc.co.uk/httpd/httpd-<strong>2.2.9</strong>.tar.gz).</p>
]]></content:encoded>
			<wfw:commentRss>http://russtaylor.co.uk/2008/08/how-to-set-up-a-debian-box-with-sshapachemysqlphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
