<?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>Avinesh's Blog &#187; mysql</title>
	<atom:link href="http://www.avinesh.com/blog/index.php/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.avinesh.com/blog</link>
	<description>Life. Technology. Cars.</description>
	<lastBuildDate>Wed, 10 Nov 2010 04:55:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Upgrading Red Hat 9 to CentOS 4.5</title>
		<link>http://www.avinesh.com/blog/index.php/2008/04/14/upgrading-red-hat-9-to-centos-45/</link>
		<comments>http://www.avinesh.com/blog/index.php/2008/04/14/upgrading-red-hat-9-to-centos-45/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 02:52:23 +0000</pubDate>
		<dc:creator>Avinesh</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.avinesh.com/blog/?p=79</guid>
		<description><![CDATA[It&#8217;s been a few months since I last posted an entry to my blog. Life has been busy. This blog has been busy, in terms of web traffic to my Anonymous Letters and Starbucks posts below. Time for a tech post. I had the privilege of upgrading an ancient Red Hat 9 Linux box to [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a few months since I last posted an entry to my blog.  Life has been busy.  This blog has been busy, in terms of web traffic to my Anonymous Letters and Starbucks posts below.</p>
<p>Time for a tech post.  I had the privilege of upgrading an ancient Red Hat 9 Linux box to CentOS 4.5.  Red Hat Linux has been EOL for a very long time, and was superceded by Fedora, which has had seven major releases.  That&#8217;s the equivalent of running Windows 3.1 <img src='http://www.avinesh.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Well, not quite <img src='http://www.avinesh.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Anyhow, the box at hand appeared to be a custom web server.  I will outline the steps I used to successfully upgrade it to CentOS 4.5.</p>
<p>1. Download the CentOS 4.5 CD set or DVD image from www.centos.org.<br />
2. Put in CD 1 or the DVD image.<br />
3. Reboot the old Red Hat 9 box and ensure that the BIOS allows booting from the CD/DVD drive.<br />
4. Enter the following at the linux boot prompt and press Enter: <em>linux upgradeany</em><br />
5. The system will happily hum along while Red Hat 9 is upgraded to CentOS 4.5.<br />
6. If &#8216;yum&#8217; wasn&#8217;t installed, you will need to install it:<br />
<em>rpm -ivh http://centos.arcticnetwork.ca/4.5/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm<br />
rpm -ivh http://centos.arcticnetwork.ca/4.5/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm<br />
rpm -ivh http://centos.arcticnetwork.ca/4.5/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm<br />
rpm -ivh http://centos.arcticnetwork.ca/4.5/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm<br />
rpm -ivh http://centos.arcticnetwork.ca/4.5/os/i386/CentOS/RPMS/yum-2.4.3-3.el4.centos.noarch.rpm</em><br />
7. Now, run the following command and press Enter: <em>yum update</em><br />
8. Allow yum to run and update the required packages.  Reboot if yum downloads and installs a new kernel.<br />
9. Since the box in question had a custom Apache and PHP configuration, I reinstalled them manually:<br />
<em>yum install httpd<br />
yum install php<br />
yum install mysql<br />
yum install mysql-server<br />
yum install php-mysql</em><br />
10. I had to update the MySQL configuration to point to the correct socket:<br />
Update my.cnf:<br />
<em>socket=/var/lib/mysql/mysql.sock</em><br />
instead of<br />
socket=/tmp/mysql.sock<br />
and add the following to use your existing database passwords<br />
<em>old_passwords=1</em><br />
11. Copy any required PHP extensions to new system path:<br />
<em>cp -R /usr/local/lib/php/extensions/* /usr/lib/php4</em><br />
12. Edit /etc/php.ini:<br />
<em>error_reporting  =  E_ALL &#038; ~E_NOTICE<br />
extension=mysql.so</em><br />
13. Finally, set services to start up automatically:<br />
<em>chkconfig &#8211;level 345 httpd on<br />
chkconfig &#8211;level 345 mysqld on<br />
chkconfig &#8211;level 345 sendmail on</em><br />
14. There you have it.  The server should be happily running CentOS 4.5 now.  Remember to keep it up-to-date by running <em>yum update </em> regularly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.avinesh.com/blog/index.php/2008/04/14/upgrading-red-hat-9-to-centos-45/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Ubuntu &#8211; Part 2</title>
		<link>http://www.avinesh.com/blog/index.php/2007/05/08/configuring-ubuntu-part-2/</link>
		<comments>http://www.avinesh.com/blog/index.php/2007/05/08/configuring-ubuntu-part-2/#comments</comments>
		<pubDate>Wed, 09 May 2007 04:22:28 +0000</pubDate>
		<dc:creator>Avinesh</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.avinesh.com/blog/?p=69</guid>
		<description><![CDATA[Opps. I just checked a few of my older blog posts and quickly realized I neglected to post part 2 of my &#8216;Configuring Ubuntu &#8211; Part 1&#8242; guide. Well, here it is! By default, Ubuntu Server installs MySQL and PHP. However, it doesn&#8217;t tweak the system for performance. If you run a WordPress blog on [...]]]></description>
			<content:encoded><![CDATA[<p>Opps. I just checked a few of my older blog posts and quickly realized I neglected to post part 2 of my &#8216;Configuring Ubuntu &#8211; Part 1&#8242; guide.</p>
<p>Well, here it is!</p>
<p>By default, Ubuntu Server installs MySQL and PHP.  However, it doesn&#8217;t tweak the system for performance.  If you run a WordPress blog on your server, you may not realize that your blog could run more efficiently.  WordPress relies on both PHP and MySQL.  PHP scripts need to be read from a server&#8217;s hard drive, parsed by the web server software and then executed.  Wouldn&#8217;t it be nice if the server could just skip the first two steps and just execute PHP scripts as quickly as plain HTML?</p>
<p>That&#8217;s where <a href="http://eaccelerator.net/" target="_blank">eAccelerator</a> comes in.  eAccelerator is a free, open-source PHP accelerator and cache.  I&#8217;ve been using it for nearly seven years on personal and commercial servers.  In other words, it&#8217;s very stable for a free product.</p>
<p>Let&#8217;s get started.<br />
<span id="more-69"></span></p>
<p>First of all, you need to ensure that you have the php5-dev package installed on your server.  It&#8217;s likely not installed, so let&#8217;s install it:</p>
<blockquote><p>
you@yourserver:~$ sudo apt-get install php5-dev
</p></blockquote>
<p>Next, download the latest build and extract it:</p>
<blockquote><p>
you@yourserver:~$ wget http://bart.eaccelerator.net/source/0.9.5.1/eaccelerator-0.9.5.1.tar.bz2<br />
you@yourserver:~$ tar -xvjf eaccelerator-0.9.5.1.tar.bz2<br />
you@yourserver:~$ cd eaccelerator-0.9.5.1
</p></blockquote>
<p>Time to compile eAcccelerator:</p>
<blockquote><p>
you@yourserver:~$ sudo find / -name phpize<br />
/usr/bin/phpize<br />
you@yourserver:~$ export PHP_PREFIX=&#8221;/usr/bin&#8221;<br />
you@yourserver:~$ $PHP_PREFIX/phpize<br />
you@yourserver:~$ ./configure &#8211;enable-eaccelerator=shared &#8211;with-php-config=$PHP_PREFIX/php-config<br />
you@yourserver:~$ sudo apt-get install make<br />
you@yourserver:~$ make
</p></blockquote>
<p>That was a mouthful, eh?  Next, we need to install the eAccelerator module we just created:</p>
<blockquote><p>
you@yourserver:~$ cd modules<br />
you@yourserver:~$ sudo cp eaccelerator.so /usr/lib/php5/20051025/
</p></blockquote>
<p>Edit your php.ini and paste the following block into it after the <em>extensions</em> block:</p>
<blockquote><p>
zend_extension=&#8221;/usr/lib/php5/20051025/eaccelerator.so&#8221;<br />
eaccelerator.shm_size=&#8221;4&#8243;<br />
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;<br />
eaccelerator.enable=&#8221;1&#8243;<br />
eaccelerator.optimizer=&#8221;1&#8243;<br />
eaccelerator.check_mtime=&#8221;1&#8243;<br />
eaccelerator.debug=&#8221;0&#8243;<br />
eaccelerator.filter=&#8221;"<br />
eaccelerator.shm_max=&#8221;0&#8243;<br />
eaccelerator.shm_ttl=&#8221;0&#8243;<br />
eaccelerator.shm_prune_period=&#8221;0&#8243;<br />
eaccelerator.shm_only=&#8221;1&#8243;<br />
eaccelerator.compress=&#8221;1&#8243;<br />
eaccelerator.compress_level=&#8221;7&#8243;
</p></blockquote>
<p>Almost done.  Create <em>/tmp/eaccelerator</em>:</p>
<blockquote><p>
you@yourserver:~$ mkdir /tmp/eaccelerator<br />
you@yourserver:~$ chmod 777 /tmp/eaccelerator
</p></blockquote>
<p>One more step!  We need to restart Apache for the changes to take effect:</p>
<blockquote><p>
you@yourserver:~$ sudo /etc/init.d/apache2 restart
</p></blockquote>
<p>There you have it.  Your PHP-based scripts and applications should run nearly 70% faster!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.avinesh.com/blog/index.php/2007/05/08/configuring-ubuntu-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

