Replace Drupal Search Box with Google Adsense Custom Search Module in Drupal 6 + Zen Theme


Drupal search doesn't work well with International language and after a couple years of using it, I decided to try Google Adsense Custom Search Engine. Well, at first, I would like to try just Google Custom Search Engine (CSE) but after reading from a few webpages, they said that both of them are the same. Google CSE will generate regular advertising while Google Adsense CSE will generate advertising that will share some revenue with the website owner. So, why use Google CSE if Google Adsense CSE can do the same while you may get some revenue. (Even it's just a little)

[HOW-TO] Fix problem with Drupal + ImageCache when use Nginx as a reverse proxy


I have set Nginx as a reverse proxy according to this tutorial -> [HOW-TO] Use Nginx as a reverse proxy for DirectAdmin which work fine. Then, I started to use Nginx to serve static files for one vhost which is running Drupal. PHP scripts still send to Apache to process through PHP-FPM. Everything seems to work fine until I found that there is one problem. The problem of images which is process by ImageCache. When I upload image, it doesn't shows as it should be.

[HOW-TO] Prevent Hotlink in Drupal 6 + Nginx


I have searched around how to prevent hotlink in Drupal when use with Nginx. A lot of website saying the same what to do. However, I have tried all of them but not even one of them that work. That was strange. I started to try more until this... I found the only method that work for me. Oh... one more thing... don't put them under "location" rule or it won't work. That took me half an hour to figure it out :(

Nginx Vhost configuration file - working config to protect hotlink

[HOW-TO] Prevent Hotlink in Drupal 6 + Apache


As far as I can remember, to prevent hotlink in Drupal is not that easy. If you search website to look for prevent hotlink, you will find a lot of them to use with .htaccess file. But those are not for Drupal. You can't just use it in Drupal .htaccess file, that won't work. However, I have a set of code that work great. Actually, I have this code long time ago but I can't remember where I got it from. Thanks for the guy that provide it. Too bad that I didn't save link at that time.

So, now, here is what we have to do :

[HOW-TO] Config Nginx to work with Drupal 6

Yesterday, I've tried to setup Nginx as a Reverse Proxy for Apache - Worker MPM base webserver. I found that it doesn't help my server performance as I expected. So, I decided to try to set up Nginx to be a Webserver to see if Nginx can give me a better performance or not.

[HOW-TO] Install mod_rpaf for Apache 2.2

When you do a reverse proxy in which Nginx will be the one who listen the traffic and forward anything needs to be process through PHP to Apache. With this, Apache will always receive an IP from Nginx server (or I should say localhost / / local IP), not the real IP that user uses. In order to let Apache knows what is real user IP, we need to install mod_rpaf.

Just copy and paste code below into SSH :

[HOW-TO] Use Nginx as a reverse proxy for DirectAdmin

I try to use Nginx as a reverse proxy to see if there is any improvement over Apache Worker MPM or not. I found an instruction from DirectAdmin webboard but it's quite old. So, I just tried to follow their steps and do some modification to match what I have read. Below is what I did

1. You need to compile Nginx. Nginx version 0.8.54 is the lastest stable release as of today. So, just copy and paste below code into your SSH

[HOW-TO] Use "mod_fastcgi_handler + PHP-FPM" instead of "mod_fastcgi + PHP-FPM" (Less code to work on)

I have read about mod_fastcgi_handler which I think it will help me to write less code to work on PHP-FPM. Checked their website, even they say it's beta quality and there are a couple bugs. I still think I should try it. So, below is what I did to replace mod_fastcgi with mod_fastcgi_handler. 1. Put the command below into the SSH.
wget --no-check-certificate
tar xvfz hollow-mod_fastcgi_handler-v0.4-0-g8973a51.tar.gz
cd hollow-mod_fastcgi_handler-8973a51
apxs -i -a -o -c *.c

[HOW-TO] DirectAdmin - Run Apache with "mod_fcgid on PHP 5.2 / 5.3" and "mod_fastcgi + PHP-FPM on PHP 5.3" on the same server

This guide [ Run Apache with "mod_fcgid on PHP 5.2 / 5.3" and "mod_fastcgi + PHP-FPM on PHP 5.3" on the same server in different Virtualhosts ] has 3 parts altogether. So, you may need to take a look at 2 other parts as well :

1. [HOW-TO] DirectAdmin with mod_fcgid
2. [HOW-TO] Enable and setup PHP-FPM in DirectAdmin (PHP 5.3)

YUM - remove cache of mirror URL to be able to switch to a new one.


I just tried to install CentOS on local machine and found that when I ran 'yum install', it will always go to specific mirror url that is so slow. I know there is some cache to tell yum to use it but I don't know where on it. Try to search in google but many problem comes up that didn't relate to what I want to fix. Until I found a link below tell me where is yum cache file located. Just run command below :