IGOS Nusantara dan nginx dan php: Perbedaan revisi
Dari IGNwiki
Baris 54: | Baris 54: | ||
Silakan test dari browser: | Silakan test dari browser: | ||
http://localhost/info.php | http://localhost/info.php | ||
+ | |||
+ | == Mengaktifkan situs di home directory == | ||
+ | location ~ ^/~(.+?)(/.*)?$ { | ||
+ | alias /home/$1/public_html$2; | ||
+ | index index.html index.htm; | ||
+ | autoindex on; | ||
+ | } |
Revisi per 21 Juli 2014 02.11
Panduan ini telah dicoba di IGOS Nusantara 9.2
Daftar isi
Pasang nginx dan modul-modul php
# Pasang nginx yum install nginx
# Pasang modul modul php yum install php-fpm php-common php-pecl-apcu php-cli \ php-pear php-pdo php-mysqlnd php-pgsql \ php-pecl-mongo php-pecl-memcache php-pecl-memcached \ php-gd php-mbstring php-mcrypt php-xml
# Pasang Zend OPcache yum install php-opcache
Jalankan
# systemctl start nginx.service systemctl start php-fpm.service
Tes halaman default
Silakan test dari browser:
http://localhost
Aktifkan nginx dan php-fpm
# systemctl enable nginx.service systemctl enable php-fpm.service
Konfgurasi /etc/nginx/nginx.conf
Baris 77 sampai 83 menjadi
location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
Jalankan ulang nginx
# systemctl reload nginx.service
<?php phpinfo(); ?>
Tes skrip info.php
Silakan test dari browser:
http://localhost/info.php
Mengaktifkan situs di home directory
location ~ ^/~(.+?)(/.*)?$ { alias /home/$1/public_html$2; index index.html index.htm; autoindex on; }