<?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>experimental</title>
	<atom:link href="http://www.tajidyakub.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tajidyakub.com</link>
	<description>Experience the Experiment</description>
	<lastBuildDate>Sat, 10 Oct 2009 19:32:38 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reinstall Yum Package Manager &#8211; in CentOS</title>
		<link>http://www.tajidyakub.com/nix-basics/reinstall-yum-package-manager-in-centos-2009-10-11.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/reinstall-yum-package-manager-in-centos-2009-10-11.html#comments</comments>
		<pubDate>Sat, 10 Oct 2009 19:32:38 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Reinstall]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://www.tajidyakub.com/?p=39</guid>
		<description><![CDATA[Somehow in an unlucky moment(s) you'll find that your yum command stop working, I have experienced it a couple of time, never find out how it happen.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/10/yum-package-reinstall-centos.jpg"><img class="aligncenter size-full wp-image-40" title="yum-package-reinstall-centos" src="http://www.tajidyakub.com/wp-content/uploads/2009/10/yum-package-reinstall-centos.jpg" alt="yum-package-reinstall-centos" width="540" height="80" /></a></p>
<p>Somehow in an unlucky moment(s) you&#8217;ll find that your yum command stop working, I have experienced it a couple of time, never find out how it happen.</p>
<p><span id="more-39"></span>It is quite simple to re install yum in an rpm base linux distros, specifically CentOS in my case. What you need to do first is to download the source file (rpm) from CentOS repo.</p>
<p>Check your current kernel, make sure you download the correct package later;</p>
<pre class="brush: bash">uname -a
Linux xxx.yyy.com 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:21:56 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux</pre>
<p>Go to the correct repo url, and search for yum rpm link url. For x86_64 Kernel, go to http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/ (assuming that you are using the latest version of CentOS), copy the link of yum package, and download them into your server, you must at this point have wget installed.</p>
<pre class="brush: bash">cd /usr/local/src/
wget http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm</pre>
<p>Check yor current version of installed yum</p>
<pre class="brush: bash">rpm -qa | grep yum
yum-metadata-parser-1.1.2-2.el5
yum-updatesd-0.9-2.el5
yum-utils-1.1.16-13.el5.centos
yum-3.2.19-18.el5.centos
yum-fastestmirror-1.1.16-13.el5.centos</pre>
<p>The result confirmed that you have yum-3.2.19-18, erase it using rpm and no dependencies check option.</p>
<pre class="brush: bash">rpm -e --nodeps yum-3.2.19-18.el5.centos</pre>
<p>Reinstall with rpm from yum rpm you just downloaded;</p>
<pre class="brush: bash">rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpm</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/reinstall-yum-package-manager-in-centos-2009-10-11.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Connection Shortcut</title>
		<link>http://www.tajidyakub.com/nix-basics/ssh-connection-shortcut-2009-09-28.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/ssh-connection-shortcut-2009-09-28.html#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:43:56 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.tajidyakub.com/?p=30</guid>
		<description><![CDATA[
Occasionally I have to leave my XP workstation and use Linux or Mac Desktop, both don&#8217;t have putty like in XP, most probably because they have built in SSH client installed :).
But I need somehow make it easier to connect from those desktop to servers with Key Authentication, instead of running this from the terminal;
ssh [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/09/openssh-mac.jpg"><img class="size-full wp-image-31 alignnone" title="openssh-mac" src="http://www.tajidyakub.com/wp-content/uploads/2009/09/openssh-mac.jpg" alt="openssh-mac" width="540" height="80" /></a></p>
<p>Occasionally I have to leave my XP workstation and use Linux or Mac Desktop, both don&#8217;t have putty like in XP, most probably because they have built in SSH client installed :).</p>
<p><span id="more-30"></span>But I need somehow make it easier to connect from those desktop to servers with Key Authentication, instead of running this from the terminal;</p>
<pre class="brush: bash">ssh -p xxxx -l root 117.103.xx.xx -i ~/ssh-keys/me\@tajidyakub.net.ppk</pre>
<p>While in Putty, I could simply use Connection Sessions preferences load a particular private key for specific connection and utilize Putty PageAnt to Authorize the pass phrase automatically. It is as simple as it gets since I only have to double click, and logged in instantly.</p>
<p>But turns out I can do the task event simpler in Linux or Mac. I create a folder in My Desktop to store my connection;</p>
<pre class="brush: bash">mkdir ~/Desktop/SSH/</pre>
<p>And create a file with .sh extension. doesn&#8217;t have to be .sh extension, just wanted to name it that way :).</p>
<pre class="brush: bash">cd ~/Desktop/SSH/
vi myserver.sh</pre>
<p>And insert the content;</p>
<pre>ssh -p xxxx -l root 117.103.xx.xx -i ~/path/to/yourprivatekey.ppk</pre>
<p>yourprivatekey.ppk is a private key, in my case, I exported it using Putty Gen from my XP machine so it is going to look like this;</p>
<pre>tjdykb$ cat me\@tajidyakub.net.ppk
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,...
nYMNS/d7RJSx1qswncyw2cd7NiCXfwZkQ6m+OMzcCtXMj8vCBDhTSyhkwxQ0lByY
tgp0zA3HkKKYI5ACl5+Q7MEZwwi+Dpz8wHY2E5adjqAbWm5M/Li9e1EBJgWM15EQ
.......
8OfpeNjO85IGBPpNYct56Z1VFCpadkph0WPE1vdrLmjhQOBu2ftamY8hJ9kFaNRH
At/j4dC4HI3kwmuM7onZIb2vZIfxmW2sUceY2NhBLEbT+kOd3Tu2/EYkKNlfmW43
3gfOqCOzUqnGON7hopzQbMK/PfvOvT+bPIE14RZG8IFhiNUu10yrd+FkF6HFlNIi
ljJTuFKDgCm/3OezeV/bzWcVMkBqoaMwxN/hI7OHe1HYb0QpZbIU/ePwt6cVGYSh
zfkIFTJl61WWTvB81oRhS5JZ6nf3OUkuFxCjJ4PseFw=
-----END RSA PRIVATE KEY-----</pre>
<p>And to load the connection from a terminal, simply execute the file (don&#8217;t forget to chmod so it becomes executable &#8211; like 755);</p>
<pre class="brush: bash">./yourserver.sh</pre>
<p>In a desktop environment, a pop up will appear asking for the pass phrases, you could add the pass phrase to your key chain or saved password avoid this the next time you load the connection.</p>
<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/09/keychain.jpg"><img class="alignnone size-full wp-image-33" title="keychain" src="http://www.tajidyakub.com/wp-content/uploads/2009/09/keychain.jpg" alt="keychain" width="540" height="260" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/ssh-connection-shortcut-2009-09-28.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Blackberry Application</title>
		<link>http://www.tajidyakub.com/etcetera/wordpress-blackberry-application-2009-09-12.html</link>
		<comments>http://www.tajidyakub.com/etcetera/wordpress-blackberry-application-2009-09-12.html#comments</comments>
		<pubDate>Sat, 12 Sep 2009 01:48:16 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Etcetera]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.tajidyakub.com/nix-basics/wordpress-blackberry-application-2009-09-12.html</guid>
		<description><![CDATA[Just heard of this interesting app from Wordpress. Simply point your bb browser to http://blackberry.wordpress.org/install and follow the installation instruction. Still in beta version though :).
]]></description>
			<content:encoded><![CDATA[<p>Just heard of this interesting app from Wordpress. Simply point your bb browser to http://blackberry.wordpress.org/install and follow the installation instruction. Still in beta version though :).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/etcetera/wordpress-blackberry-application-2009-09-12.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup Outbound Mail IP Address for Postfix</title>
		<link>http://www.tajidyakub.com/etcetera/setup-outbound-mail-ip-address-for-postfix-2009-09-12.html</link>
		<comments>http://www.tajidyakub.com/etcetera/setup-outbound-mail-ip-address-for-postfix-2009-09-12.html#comments</comments>
		<pubDate>Sat, 12 Sep 2009 00:28:58 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Etcetera]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MTA]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.tajidyakub.com/?p=17</guid>
		<description><![CDATA[
If you have aliased IP Address, all connection made from your server will be seen as you main IP Address by the outside world, unless of course, stated otherwise.
In this case, one of my server have around 5 usable IP Address, and only two are effectively in use, one for the the web server and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/09/postfix-header.jpg"><img class="aligncenter size-full wp-image-18" title="postfix-header" src="http://www.tajidyakub.com/wp-content/uploads/2009/09/postfix-header.jpg" alt="postfix-header" width="600" height="140" /></a></p>
<p>If you have aliased IP Address, all connection made from your server will be seen as you main IP Address by the outside world, unless of course, stated otherwise.</p>
<p><span id="more-17"></span>In this case, one of my server have around 5 usable IP Address, and only two are effectively in use, one for the the web server and the other is for inbound Mail Server IP Address.  I am using postfix MTA which by default listen to all IP Address(es) in your server including the loopback (localhost).</p>
<p>If you want to use a dedicated IP Address to send emails to the outside world, in postfix, you can either;</p>
<ul>
<li>Set the inet_interfaces into one spesific IP Address, e.g. inet_interfaces = 117.103.xx.xx, the IP Address can&#8217;t be loopback address.</li>
<li>Or, use the smtp_bind_address parameter</li>
</ul>
<h2>SMTP Bind Address</h2>
<p>I need postfix to listen on loopback address, so option one is no go, so I try using option smtp_bind_address, which according to the manual can be configured either through main.cf, or master.cf.</p>
<p>I try master.cf first so I can use different IP Address from the one use by inbound mail, but was not successful, so I try to put the parameter in the main.cf.</p>
<pre>smtp_bind_address = 117.103.xx.xx</pre>
<p>Where 117.103.xx.xx is the same IP Address used by mx host name stated in the DNS config. I am still experimenting with the master.cf, and intend to update this post when successful.</p>
<h2>References:</h2>
<ul>
<li><a href="http://www.postfix.org/postconf.5.html#smtp_bind_address">http://www.postfix.org/postconf.5.html#smtp_bind_address</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/etcetera/setup-outbound-mail-ip-address-for-postfix-2009-09-12.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing Nginx Server Version</title>
		<link>http://www.tajidyakub.com/web-servers/removing-nginx-server-version-2008-07-31.html</link>
		<comments>http://www.tajidyakub.com/web-servers/removing-nginx-server-version-2008-07-31.html#comments</comments>
		<pubDate>Wed, 30 Jul 2008 19:52:37 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[server tokens]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=16</guid>
		<description><![CDATA[Just add the following configuration on http {} directive inside your nginx.conf
http {
...
server_tokens   off;
...
}
]]></description>
			<content:encoded><![CDATA[<p>Just add the following configuration on http {} directive inside your nginx.conf</p>
<pre class="brush: bash">http {
...
server_tokens   off;
...
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/web-servers/removing-nginx-server-version-2008-07-31.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTPS, SSL and Nginx</title>
		<link>http://www.tajidyakub.com/web-servers/https-ssl-and-nginx-2008-07-27.html</link>
		<comments>http://www.tajidyakub.com/web-servers/https-ssl-and-nginx-2008-07-27.html#comments</comments>
		<pubDate>Sat, 26 Jul 2008 18:37:15 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=15</guid>
		<description><![CDATA[Say you want to run https port on nginx using a self signed SSL Certificate, this article summarized the steps. First we create the SSL Key, CSR (Certificate Signing Request) and CRT (SSL Certificate) and Configure nginx to answer the request from SSL port.

These are the original articles;
http://rubyjudo.com/2006/11/2/nginx-ssl-rails
http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx
 http://blog.skateinmars.net/post/2007/11/01/phpMyAdmin-and-HTTPS-on-nginx
The aim is to run phpMyAdmin in [...]]]></description>
			<content:encoded><![CDATA[<p>Say you want to run https port on nginx using a self signed SSL Certificate, this article summarized the steps. First we <strong>create the SSL Key, CSR (Certificate Signing Request) and CRT (SSL Certificate) and Configure nginx</strong> to answer the request from SSL port.</p>
<p><span id="more-15"></span></p>
<p><strong>These are the original articles;</strong></p>
<p><a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx" target="_blank">http://rubyjudo.com/2006/11/2/nginx-ssl-rails<br />
</a><a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx" target="_blank">http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx</a><br />
<a href="http://blog.skateinmars.net/post/2007/11/01/phpMyAdmin-and-HTTPS-on-nginx" target="_blank"> http://blog.skateinmars.net/post/2007/11/01/phpMyAdmin-and-HTTPS-on-nginx</a></p>
<p>The aim is to run <a title="phpMyAdmin" href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> in secured mode served by <a title="Nginx" href="http://nginx.net" target="_blank">nginx</a>.<br />
<strong></strong></p>
<p><strong>Create Keys and Certificates</strong></p>
<p>Make a temp directory and remove it later after the setup succeed.</p>
<pre class="brush: bash">mkdir /home/username/temp
cd /home/username/temp
</pre>
<p>Create the private key, it will require a passphrase (it will be removed later on)</p>
<pre class="brush: bash">openssl genrsa -des3 -out pma.key 1024</pre>
<p>Create the CSR (Certificate Signing Request), and enter the information required;</p>
<pre class="brush: bash">openssl req -new -key pma.key -out pma.csr</pre>
<p>Then we remove the passphrase entered earlier when we create the key, if not, the box will ask us to enter the passphrase on every reboot.</p>
<pre class="brush: bash">cp pma.key pma.key.org
openssl rsa -in pma.key.org -out pma.key</pre>
<p>Afterward, the digital certificate itself</p>
<pre class="brush: bash">openssl x509 -req -days 365 -in pma.csr -signkey pma.key -out pma.crt</pre>
<p>The last thing is to put the files in the right place, to be called later by nginx, the final directory will depend on your config, in my case I want to put it inside nginx directory.</p>
<pre class="brush: bash">mkdir /usr/local/nginx/cert
cp pma.crt pma.key /usr/local/nginx/cert</pre>
<p>Feel free to delete the temporary directory created for this purpose, or you might want to wait until your setup is done.</p>
<p><strong>Nginx Virtual Host HTTPS</strong></p>
<p>This is my final setup on phpMyAdmin subdomain (only the server part), I really can&#8217;t explain anything for now :), I just now it worked.</p>
<pre class="brush: bash">server {
listen pma.yourdomain.com:443;
client_max_body_size 10M;
index index.php;
server_name pma.yourdomain.com;
root /var/www/pma.yourdomain.com;

ssl on;
ssl_certificate /usr/local/nginx/certs/pma.crt;
ssl_certificate_key /usr/local/nginx/certs/pma.key;

location / {
proxy_set_header X_FORWARDED_PROTO https;
proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_max_temp_file_size 0;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param HTTPS on;
include /usr/local/nginx/conf/fastcgi_params;

}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/web-servers/https-ssl-and-nginx-2008-07-27.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indonesian CentOS 5.2 Repo (IIX and openIXP)</title>
		<link>http://www.tajidyakub.com/etcetera/indonesian-centos-52-repo-iix-openixp-2008-06-28.html</link>
		<comments>http://www.tajidyakub.com/etcetera/indonesian-centos-52-repo-iix-openixp-2008-06-28.html#comments</comments>
		<pubDate>Sat, 28 Jun 2008 04:32:04 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Etcetera]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[repo]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=14</guid>
		<description><![CDATA[For Indonesian CentOS user who search for fast IIX (Local) Repo to update ver.5.2 including x86_64, you could point your repo to http://mirror.lintaswave.net.id/centos/ .
Update
This repo is no longer available, use http://mirror.biz.net.id/ it is the best one available right now (IMO).
]]></description>
			<content:encoded><![CDATA[<p>For Indonesian CentOS user who search for fast IIX (Local) Repo to update ver.5.2 including x86_64, you could point your repo to <a title="CentOS Indonesian Repo" href="http://mirror.lintaswave.net.id/centos/" target="_blank">http://mirror.lintaswave.net.id/centos/</a> .</p>
<h2>Update</h2>
<p>This repo is no longer available, use <a href="http://mirror.biz.net.id/">http://mirror.biz.net.id/</a> it is the best one available right now (IMO).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/etcetera/indonesian-centos-52-repo-iix-openixp-2008-06-28.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx, MySQL, PHP in CentOS 5.1 (x86_64)</title>
		<link>http://www.tajidyakub.com/web-servers/nginx-mysql-php-in-centos-51-x86_64-2008-06-28.html</link>
		<comments>http://www.tajidyakub.com/web-servers/nginx-mysql-php-in-centos-51-x86_64-2008-06-28.html#comments</comments>
		<pubDate>Sat, 28 Jun 2008 03:29:29 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Web Database]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=13</guid>
		<description><![CDATA[Nginx (pronounced &#8220;engine x&#8221;) is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Written by Igor Sysoev in 2005, still in beta, Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption, taken from the wiki. I will not go deeper on [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Nginx" href="http://nginx.net" target="_blank">Nginx</a> (pronounced &#8220;engine x&#8221;) is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Written by <a title="Nginx Developer" href="http://sysoev.ru/en/" target="_blank">Igor Sysoev</a> in 2005, still in beta, Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption, <a title="nginx wiki" href="http://wiki.codemongers.com/Main" target="_blank">taken from the wiki</a>. I will not go deeper on the subject of nginx as a preferrable alteranate HTTP Server asides from <a title="Apache HTTP Server" href="http://httpd.apache.org/" target="_blank">Apache</a>, since I don&#8217;t have a lot of knowledge on the subject.</p>
<p>This article intends to show you a step by step tutorial on how to install (and do basic configuration) for Nginx powered Web Sites with <a title="PHP Site" href="http://php.net" target="_blank">PHP</a> (through <a title="php-fpm" href="http://php-fpm.anight.org/" target="_blank">php-fpm</a>) and <a title="MySQL" href="http://mysql.com/" target="_blank">MySQL</a> Enabled in <a title="CentOS!" href="http://centos.org" target="_blank">CentOS 5.1</a> (x86_64) Virtual Box. The Box is from <a title="Magnet Hosting and Server" href="http://magnet-id.com" target="_blank">Magnet VPS</a> (Entry with 128MB Dedicated RAM, 256MB SWAP Space and 5GB HDD Space).</p>
<p><span id="more-13"></span></p>
<p><strong>Install and Securing (Basic) MySQL</strong></p>
<pre class="brush: bash">

yum install -y mysql-server mysql-devel
service mysqld start
mysql_secure_installation

Enter current password for root (enter for none): Enter
Set root password? [Y/n] Y
New password: rootpasssql
Re-enter new password: rootpasssql
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
</pre>
<p><strong>Install Required Package for Compiling</strong></p>
<p>We need to install a few basic package since this is a very base install of CentOS, some of the package will depend on your wanted php configuration.</p>
<pre class="brush: bash">

yum install -y wget patch gcc libtool libmcrypt-devel libxml2-devel flex bison make pcre-devel zlib-devel openssl-devel gd-devel
</pre>
<p><strong>Install PHP From Source</strong></p>
<p>We are going to install PHP 5.2.6 along with php-fpm patch (patch for PHP to improve FastCGI SAPI Usage in Production)</p>
<pre class="brush: bash">
cd /usr/local/src
wget http://id2.php.net/get/php-5.2.6.tar.gz/from/id2.php.net/mirror
tar xzvf php-5.2.6.tar.gz
wget http://php-fpm.anight.org/downloads/head/php-5.2.6-fpm-0.5.8.diff.gz
gzip -cd php-5.2.6-fpm-0.5.8.diff.gz | patch -d php-5.2.6 -p1
cd php-5.2.6
./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --disable-pdo --disable-reflection --with-libdir=lib64
make all install
strip /usr/local/bin/php-cgi
</pre>
<p>Adjust php-fpm configuration, remove the comment sign in line 63 and 65, adjust the user in which nginx will run, in this example I am using nobody (default)</p>
<pre class="brush: bash">
vi /usr/local/etc/php-fpm.conf
&lt;value name=&quot;user&quot;&gt;nobody&lt;/value&gt;
&lt;value name=&quot;group&quot;&gt;nobody&lt;/value&gt;
</pre>
<p>Now we will install X-Cache opcode php cacher</p>
<pre class="brush: bash">
cd /usr/local/src
wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
tar xzvf xcache-1.2.2.tar.gz
cd xcache-1.2.2
phpize
./configure --with-php-config=/usr/local/bin/php-config --enable-xcache
make install
</pre>
<p>Insert xcache in php.ini</p>
<pre class="brush: bash">

vi /usr/local/lib/php.ini

magic_quotes_gpc=0
[xcache-common]
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
[xcache]
xcache.shm_scheme = &quot;mmap&quot;
xcache.size = 64M
</pre>
<p>Check your PHP Installation</p>
<pre class="brush: bash">
php -v
PHP 5.2.6 (cli) (built: Jun 28 2008 08:56:02)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with XCache v1.2.2, Copyright (c) 2005-2007, by mOo
</pre>
<p><strong>Init Script for php-fpm</strong></p>
<p>Put php-fpm init script in your rc.local to auto start during reboot</p>
<pre class="brush: bash">
cd /etc/init.d/
ln -s /usr/local/sbin/php-fpm php-fpm

## add this line to /etc/rc.local ##
/etc/init.d/php-fpm
</pre>
<p><strong>Install Nginx</strong></p>
<p>Now we will install nginx, the current stable version is 0.6.31, check their site for updates;</p>
<pre class="brush: bash">
export NGINX=0.6.31
cd /usr/local/src
wget http://sysoev.ru/nginx/nginx-${NGINX}.tar.gz
tar xfz nginx-${NGINX}.tar.gz
cd nginx-${NGINX}
./configure --pid-path=/usr/local/nginx/logs/nginx.pid --sbin-path=/usr/local/sbin/nginx --with-md5=/usr/lib --with-sha1=/usr/lib --with-http_ssl_module  --with-http_dav_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module
make
make install
</pre>
<p><strong>Nginx Daemon for CentOS</strong></p>
<p>Get Nginx daemon for CentOS and add the service to startup so it start automatically during reboot.</p>
<pre class="brush: bash">
wget http://notrocketsurgery.com/files/nginx -O /etc/init.d/nginx
chmod 750 /etc/init.d/nginx
## Install start-stop-daemon ##
cd /usr/local/src
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-1.tar.gz
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-1.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-1/
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin
chkconfig --add nginx
chkconfig --level 345 nginx on
</pre>
<p><strong>Configure Nginx</strong></p>
<p>This is a sample configuration for wordpress running on nginx web sites. Notice that I am disabling logs, the sample is only for basic configuration, you should read more on nginx manual for the configuration directive.</p>
<pre class="brush: bash">

service nginx start
## Edit the main configuration File ##
vi /usr/local/nginx/conf/nginx.conf
## Put only these lines ##
user  nobody;
worker_processes  5;
error_log  /var/log/nginx/error.log;
events {
worker_connections  768;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nodelay on;
keepalive_timeout 10 10;
gzip on;
gzip_comp_level 1; gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

server {
listen  80;
server_name your.hostname.tld;
location / {
root   html;
autoindex  off;
index  index.html index.htm;
}
}
include /usr/local/nginx/sites-enabled/*;
}

## Make a sites config ##
cd /usr/local/nginx
mkdir sites-enabled
cd sites-enabled
vi yourwordpressblog.tld

## Put these lines ##

server {
listen yourwordpressblog.tld:80;
server_name yourwordpressblog.tld www.yourwordpressblog.tld;
index index.php;
root /var/www/yourwordpressblog.tld;

location / {
error_page 404 = //index.php?q=$uri;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
}
}

## Add this line to fastcgi_params /usr/local/nginx/fastcgi_params##
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
</pre>
<p>Make the root www directory for your wordpressblog, this is subject for security notice in the future, I haven&#8217;t look further.</p>
<pre class="brush: bash">
mkdir -p /var/www/yourwordpressblog.tld
touch /var/www/yourwordpressblog.tld/index.php
chown -R nobody.nobody /var/www/yourwordpressblog.tld
</pre>
<p>Restart nginx, but make sure that your domain already resolved to your nginx web server, otherwise it will fail to start.</p>
<pre class="brush: bash">
service nginx restart
</pre>
<h2>Update</h2>
<p>It is now CentOS 5.3, PHP and fpm patch 5.2.10, and nginx 0.7.61 stable release. This post is obsolete, unless you can modify the steps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/web-servers/nginx-mysql-php-in-centos-51-x86_64-2008-06-28.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installation and Basic Configuration Apache, MySQL and PHP on CentOS 5.1 (64 bit)</title>
		<link>http://www.tajidyakub.com/web-servers/installation-and-basic-configuration-apache-mysql-and-php-on-centos-51-64-bit-2008-06-27.html</link>
		<comments>http://www.tajidyakub.com/web-servers/installation-and-basic-configuration-apache-mysql-and-php-on-centos-51-64-bit-2008-06-27.html#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:48:05 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Web Database]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=11</guid>
		<description><![CDATA[These are the simple steps to Install and do basic configuration Apache 2.2.3, MySQL 5.0.22 and PHP on a base install CentOS 5.1 x86_64.

Required Pack
Install the required package using yum;


yum install gettext httpd mysql mysql-server perl

yum install php php-mysql php-xml php-imap php-mbstring php-mcrypt php-pecl-Fileinfo php-pecl-memcache php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime php-pear-Auth-SASL php-pear-Date php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve php-pear-Net-Socket [...]]]></description>
			<content:encoded><![CDATA[<p>These are the simple steps to Install and do basic configuration Apache 2.2.3, MySQL 5.0.22 and PHP on a base install CentOS 5.1 x86_64.</p>
<p><span id="more-11"></span></p>
<p><strong>Required Pack</strong></p>
<p>Install the required package using yum;</p>
<pre class="brush: bash">

yum install gettext httpd mysql mysql-server perl

yum install php php-mysql php-xml php-imap php-mbstring php-mcrypt php-pecl-Fileinfo php-pecl-memcache php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime php-pear-Auth-SASL php-pear-Date php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve php-pear-Net-Socket php-pear-Net-SMTP

yum install openssl perl-Net-SSLeay

yum install php-devel gcc
</pre>
<p><strong>Start the Service</strong></p>
<p>Start Apache and MySQL daemon, and add them to startup script so it will survive reboot.</p>
<pre class="brush: bash">

service httpd restart
chkconfig httpd on

service mysqld restart
chkconfig mysqld on
</pre>
<p><strong>Standard MySQL First Step After Install</strong></p>
<p>Run the mysql_secure script to do basic securing MySQL and give root password to your MySQL databases;</p>
<pre class="brush: bash">mysql_secure_installation</pre>
<p><strong>Apache and Basic Virtual Host Configuration</strong></p>
<p>Edit the apache configuration file to fit your requirement.</p>
<pre class="brush: bash">

vi /etc/httpd/conf/httpd.conf

###Modify

Listen vvv.xxx.yyy.zzz:80  &lt;--Put your IP Address here

###Add

&lt;Directory “/path/to/rootwwwdir/public_html”&gt;
Options Indexes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
AllowOverride None
&lt;/Directory&gt;

&lt;Directory “/path/to/rootwwwdir/public_html”&gt;
Options Indexes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
AllowOverride None
&lt;/Directory&gt;

Virtual Host Configuration

NameVirtualHost vvv.xxx.yyy.zzz:80

&lt;VirtualHost vvv.xxx.yyy.zzz:80&gt;
ServerAdmin hostmaster@magnet-id.com
DocumentRoot /path/to/rootwwwdir/public_html
ServerName virt1.magnet-id.com
ErrorLog logs/virt1.magnet-id.com-error_log
CustomLog logs/virt1.magnet-id.com-access_log common
&lt;/VirtualHost&gt;

&lt;VirtualHost vvv.xxx.yyy.zzz:80&gt;
ServerAdmin hostmaster@magnet-id.com
DocumentRoot /path/to/rootwwwdir/public_html
ServerName virt2.magnet-id.com
ErrorLog logs/virt2.magnet-id.com-error_log
CustomLog logs/virt2.magnet-id.com-access_log common
&lt;/VirtualHost&gt;

###Empty the file
/etc/httpd/conf.d/welcome.conf
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/web-servers/installation-and-basic-configuration-apache-mysql-and-php-on-centos-51-64-bit-2008-06-27.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding SWAP Space On-The-Fly</title>
		<link>http://www.tajidyakub.com/nix-basics/adding-swap-space-on-the-fly-2008-06-27.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/adding-swap-space-on-the-fly-2008-06-27.html#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:24:41 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=10</guid>
		<description><![CDATA[If somehow you need to add SWAP space in your Linux Box without having to reboot your Box, you could follow these steps. Basically create an Image in your HDD, format it to swap file system, and add it to your swap space, optionally you could add it to your fstab, so it still there [...]]]></description>
			<content:encoded><![CDATA[<p>If somehow you need to add SWAP space in your Linux Box without having to reboot your Box, you could follow these steps. Basically create an Image in your HDD, format it to swap file system, and add it to your swap space, optionally you could add it to your fstab, so it still there during a reboot.</p>
<p><strong>Build the Image</strong></p>
<p>Build the image using dd command, give the size according to your needs. This example shows a 512MB image file.</p>
<pre class="brush: bash">dd if=/dev/zero of=/path/to/directory/swap.image oflag=direct bs=1M count=512</pre>
<p><strong>Format the Image</strong></p>
<p>Format the image to SWAP file type.</p>
<pre class="brush: bash">mkswap  /direktori/swap.image</pre>
<p><strong>Activate Your Newly Created SWAP Image</strong></p>
<pre class="brush: bash">mkswap  /path/to/directory/swap.image</pre>
<p><strong>Configure fstab</strong></p>
<p>If you want the SWAP survive reboot.</p>
<pre class="brush: bash">vi /etc/fstab

### add the line similar to

/path/to/directory/swap.image swap                    swap    defaults        0 0</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/adding-swap-space-on-the-fly-2008-06-27.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
