Install Nginx, PHP-FPM & MySQL in Centos

April 21, 2011 | Technical Stuffs | , , , , ,

Warning: This shell script will remove your previous Apache installation.
Update June, 25 2014:
The following script works on CentOS 5 very well. If you’re using CentOS 6, go to this page instead:

After reading a tutorial of how to install Nginx, PHP and MySQL in a difficult way, now I would like to tell ya how to install them in a very easy way.

I found this method was very effective and completed just within few minutes in my Centos VPS.

  1. Download  this shell script to your VPS
    [root@power ~]# wget
  2. Run that bash script
    [root@power ~]# bash

    then wait..

  3. Voila! Nginx, PHP-FPM and MySQL are installed at glance!

Not only that, this shell script also installed a tool to create virtual host in Nginx named setup-vhost.

When I made virtual host for this blog, I just need to run this command:

[root@power ~]# setup-vhost

Then I uploaded all my files at /var/www/ and configure database connection etc.

Thanks to you guys at, installing this stack never been easier than this!


Wrong mail quota in CPanel

May 9, 2010 | Technical Stuffs | , , , ,

Today I found my CPanel displays wrong disk quota for an email account. It shows 58/100 MB (58 MB used, of 100 MB preserved) while actually the mailbox is empty.

I have checked with du -sh command (a command to check disk usage) and it returned 100 KB or something, so there must be something wrong.

After googling around, I got some trick to solve this problem. Perform this action from shell/SSH or simply using file manager in CPanel:

  1. Go to /home/usercpanel/mail/
  2. Delete file named maildirsize, this file stores disk usage information
  3. Change the number of disk quota for that email account from CPanel (inside menu Email Accounts), it will regenerate a new maildirsize file.

Refresh your browser and now you should see the correct disk quota for that email account.


Agregator sederhana dengan Yahoo! pipes

May 4, 2010 | Technical Stuffs | , , , , ,

Yahoo! PipesAda 3 blog saya yang ingin saya masukkan ke dalam agregator milik CahAndong, namun saya tidak ingin membebani Kang Zamroni dengan memasukkan 3 URL yang berbeda, dan mungkin bisa bertambah jumlahnya.

Akhirnya saya manfaatkan Yahoo! Pipes untuk membuat sebuah agregator sederhana yang akan mengambil data dari RSS feed di ketiga blog yang saya kelola. Selanjutnya pipes ini akan menyortir entry terbaru (berdasar tanggal posting) dan mengirimkan hanya 9 output terbaru saja.

Saya kurang yakin apakah langkah keempat dalam alur piping di sebelah kiri ini ada gunanya atau tidak, agak malas ngotak-atik lagi hehe.

Enaknya Yahoo! Pipes ini adalah kita bisa memilih output yang diinginkan. Dalam hal ini saya memilih output dalam bentuk RSS, lalu saya grab dan bisa diakses dengan mudah dari alamat 😀

Jadi jika nanti saya nambah blog lagi, saya cukup memasukkan ke dalam pipe ini saja sebagai input awal dan output-nya akan otomatis menyesuaikan.

Beginilah kalau terlalu malas he..he..


Create PDF Files For Free

April 11, 2010 | Technical Stuffs | , ,

I was wondering why many people still using Adobe Acrobat for creating PDF files from their documents. It’s bloated –or you can say my computer is too old– and of course expensive! Some minutes ago I’ve checked the price on their website, it costs US$ 299.

Why don’t people find an alternative PDF-maker software which is free and lightweight? I know that you can get any serial number from Internet for Adobe Acrobat to turn that pricey software into a free one. But hey, it’s like stealing from a kid’s pocket.

A few days ago –when I needed a software to convert my documents into PDFs– I found doPDF which is free and lightweight. And most of all, it doesn’t require any Ghostscript installation just like any other PDF printers.


Perhaps it doesn’t have all the features you want and requires you to upgrade to the paid version but it’s enough for me. Awesome PDF printer.

This way I thank to doPDF developer(s) for their great work.

1 comment

Redirect Old URLs to New URLs

April 3, 2010 | Technical Stuffs | , , ,

When we have a completely new website and uses different CMS, there will be old URLs that already spread everywhere on the Net. Discarding old URLs is not an option because we will lost visitors from search engines. So we must redirect all old URLs into new URLs.

Using redirect in .htaccess is great, but when your old URLs contain question mark, most likely it will fail to redirect.

Following code will work:

redirect 301 /old-url.html
redirect 301 /very-old.html  

But following code will –at least in my case– failed:

redirect 301 /file.php?age=old
redirect 301 /file.php?age=old&id=12  

Luckily there’s 404 directive from Apache using .htaccess. We can mix the power of custom 404 page with PHP to perform this directions stuff. Here’s how to mix them up:

Create custom 404 page using .htaccess

ErrorDocument 404 /redirect.php

Then create file redirect.php with following contents:

< ?php
$req = trim($_SERVER['REQUEST_URI']);
	case "/file.php?age=old":
		$goto = "";
	case "/file.php?age=old&id=12";
		$goto = "";
		$goto = "";
header ("HTTP/1.1 301 Moved Permanently");
header ("Location: $goto");

By this method, old URLs that are no longer exist are forwarded to our custom 404 page (named redirect.php) and that redirect.php will bring visitors to new URLs.

Nice, isn’t it?


Error on Webmail, Query: SELECT “INBOX”

November 7, 2009 | Technical Stuffs | ,

If you got following error message when accessing webmail using Squirrelmail or other brand:

Reason Given: Internal error occurred. Refer to server log for more information. [2009-11-03 15:47:40]

The cure is really easy. Check /home/user/mail/ and see its subdirectories’ permission.

In my case, I just need to perform chown command to assign the directories/files under user’s ownership and the problem is gone.

No comment

Invalid field count in csv input on line 1

July 18, 2009 | Technical Stuffs | , , , ,

When importing CSV data into my MySQL database using PHPMyAdmin, I found following error: Invalid field count in csv input on line 1.

It’s odd since I’ve manually count field numbers and compared with column on my CSV files, they’re exactly match.

Then I found something strange. PHPMyAdmin is automatically use semicolon ( ; ) as field delimiter instead of comma ( , ). Quick fix for this problem is to change the delimiter symbol manually.

phpMyAdmin screenshot

In the picture above, I replaced semicolon (rounded with blue circle) with comma and everything is alright.


WordPress: Your hosting does not support this feature

June 12, 2009 | Technical Stuffs | , , , , ,

I was moving wordpress installation from one server into another. I copy the files, import database and modify configuration file (wp-config.php) and trying to access the page. But I only get following message:

Your hosting does not support this feature.

I logged into my shell account, checked permission files and found that some files have wrong user permission. So I just change user permission using command chown -R myuser:mygroups *.

I refresh the page, and the world become so beautiful tonight.


Multiple Shoutcast Streams on A Single Machine

May 24, 2009 | Technical Stuffs

It’s very easy to set multiple shoutcast streams/servers on a single server. In this example I’m using Centos.

All you need to do is copy sc_serv binary into 3 different files (ie: sc_serv1, sc_serv2, sc_serv3) and create 3 different configuration files (ie: sc_serv1.conf, sc_serv2.conf, sc_serv3.conf).

Don’t forget to specify different ports for the three configuration files.

I put them into /usr/local/sbin/ directory:

[root@myserver sbin]# ls | grep -v log


1 comment

Desktop Blog Editor Failed to Post Article on WordPress 2.7

April 8, 2009 | Technical Stuffs | , , , , , , , , , ,

If you’re writing article for your blog using desktop blog editor –such as ecto, Qumana, Performancing for Firefox, Flock blog editor, Zoundry, ScribeFire, w.bloggar or aything else — there is a big chance that you are experiencing problem when your wordpress engine is upgraded to 2.7.

Error message may vary, but you will see something like:
XML-RPC services are disabled on this blog. An admin user can enable them at

To fix this problem is very easy. Just login to your wp-admin and go to options-writing.php page. Look at the Remote Publishing part, now give checkmark on the Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.

Now you can write article using your favourite desktop blog editor again.

No comment