Ada dua jenis MPM yang sering dipakai yaitu prefork dan worker.
Masing-masing ada kelebihan dan kekurangan.
Cek modul yang telah di-loading oleh Apache :
$ apachectl -l
Dari terminal console :
$ sudo apt-get install apache2-mpm-worker
$ sudo apt-get install libapache2-mod-fastcgi php5-fpm php5
Paket libapache2-mod-fastcgi ada di dalam repository
multiverse
. Jadi mungkin anda mendapatkat error saat instalasi. Jika anda menggunakan Ubuntu 12.04, periksa /etc/apt/sources.list dan buka komen dari baris-baris berikut :deb http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb http://security.ubuntu.com/ubuntu precise-security multiverse
Jalankan :
$ sudo apt-get
Dan ulangi :
$ sudo apt-get install libapache2-mod-fastcgi php5-fpm php5
Aktifkan modul-modul di Apache :
$ sudo a2enmod actions fastcgi alias
Restart Apache :
$ sudo service apache2 restart
Ada yang perlu diubah di konfigurasi Apache.
Buat berkas konfigurasi di : /etc/apache2/conf.d/php5-fpm.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_fastcgi.c> | |
AddHandler php5-fcgi .php | |
Action php5-fcgi /php5-fcgi | |
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi | |
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization | |
<Directory /usr/lib/cgi-bin> | |
Order allow,deny | |
Allow from all | |
</Directory> | |
</IfModule> |
Restart kembali Apache :
$ sudo service apache2 restart
Selamat mencoba PHP5 dengan FastCGI.