Professional Documents
Culture Documents
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server ipv6only=on;
4
5 root /usr/share/nginx/html;
6 index index.html index.htm;
root : document root directory, biasanya kalau memakai Apache lokasinya
di /var/www/
index : file yang menjadi index pada directory atau file yang pertama dibaca
dalam directroy. tambahkan index.php
1 location ~ .php$ {
2 try_files $uri =404; ---------> Tambahkan baris ini
3 fastcgi_split_path_info ^(.+.php)(/.+)$;
4 # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
5 #
6 # # With php5-cgi alone:
7 # fastcgi_pass 127.0.0.1:9000;
8 # # With php5-fpm:
9 fastcgi_pass unix:/var/run/php5-fpm.sock;
10 fastcgi_index index.php;
11 include fastcgi.conf;
12 }
Uji coba konfigurasi nginx
1 sudo nginx -t
Hasilnya
Install PHP
1 cgi.fix_pathinfo=0
Restart fpm service
Install MariaDB
Ulangi password
1 mysql -u root -p
2 Enter password:
3 Welcome to the MariaDB monitor. Commands end with ; or g.
4 Your MariaDB connection id is 56
5 Server version: 5.5.41-MariaDB-1ubuntu0.14.04.1 (Ubuntu)
6
7 Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
8
9 Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
10
11 MariaDB [(none)]>
Install phpMyAdmin
1 sudo apt-get install phpmyadmin
Pilih Yes
Ulangi password