Sebelum install nginx pada mesin (Centos 5.5 64bit) , sata menambahkan repo rusia terlebih dahulu.
[root@prayoga ~]# nano /etc/yum.repos.d/rusia-repo.repo tambahkan baris berikut : [rusia-repo] name=CentOS-$releasever . rusia packages for $basearch #baseurl=file:///raid/RH/CentOS/$releasever/local/$basearch baseurl=http://centos.alt.ru/pub/repository/centos/5/x86_64/ enabled=1 gpgcheck=0 protect=1
installasi nginx
[root@prayoga ~]# yum update [root@prayoga ~]# yum install nginx-stable php-xcache php-fpm
catatan, untuk installasi module php bisa disesuaikan kebutuhan. Saya install 2 module di catatan ini, karena pada catatan http://www.idprayoga.com/2011/03/installasi-apache-mysql-dan-php-pada.html saya sudah menginstall beberapa module php.
Konfigurasi nginx
[root@prayoga ~]# nano /etc/nginx/nginx.conf Add / Uncomment this line # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; include fastcgi_params; }
start service php-fpm dan nginx
[root@prayoga ~]# /etc/init.d/php-fpm start [root@prayoga ~]# /etc/init.d/nginx start
Cek port service :
[root@prayoga ~]# netstat -tlnup Active Internet connections (only servers) tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 930/php-cgi tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 27143/nginx.conf
Referensi: tox_penguin
1 comments:
kita juga punya nih artikel mengenai 'NGINX, PHP, dan MySQL', silahkan dikunjungi dan dibaca , berikut linknya
http://repository.gunadarma.ac.id/bitstream/123456789/5391/1/dokumen%20presentasi.pdf
terimakasih
Post a Comment