0% found this document useful (0 votes)
42 views7 pages

Konfig Nginx Mariadb PHP Phpmyadmin

1. The document provides instructions for installing and configuring Nginx, PHP, MariaDB, and phpMyAdmin on a server. 2. It includes commands to install each component through apt-get and configure settings like virtual hosts, PHP configurations, and database passwords. 3. Basic tests are outlined to validate the installations, like accessing web pages and logging into the database.

Uploaded by

Bintang Khalil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views7 pages

Konfig Nginx Mariadb PHP Phpmyadmin

1. The document provides instructions for installing and configuring Nginx, PHP, MariaDB, and phpMyAdmin on a server. 2. It includes commands to install each component through apt-get and configure settings like virtual hosts, PHP configurations, and database passwords. 3. Basic tests are outlined to validate the installations, like accessing web pages and logging into the database.

Uploaded by

Bintang Khalil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Install Nginx

Perintah install nginx

1 sudo apt-get install nginx


Jalankan serive nginx

1 sudo service nginx start


Test di browser dengan mengakses http://localhost atau http://IP-ADDRESS

Konfigurasi virtual host, buka file /etc/nginx/sites-available/default

1 sudo nano /etc/nginx/sites-available/default


Cari baris

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 index index.php index.html index.htm;


Selanjutnya untuk pembacaan file .php, cari baris location ~ .php. Lepas
tanda komentar seperti pada kode dibawah ini.

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

1 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok


2 nginx: configuration file /etc/nginx/nginx.conf test is successful
Restart nginx

1 sudo service nginx restart

Install PHP

1 sudo apt-get install php5 php5-fpm php5-mysql


Konfigurasi PHP, buka file php.ini

1 sudo nano /etc/php5/fpm/php.ini


Cari baris cgi.fix_pathinfo=1, lepas komentar dan ubah nilainya menjadi 0

1 cgi.fix_pathinfo=0
Restart fpm service

1 sudo service php5-fpm restart


Uji coba file PHP

1 sudo nano /usr/share/nginx/html/test.php


Masukkan kode phpinfo

1 <?php phpinfo(); ?>


Akses http://localhost/test.php, hasilnya

Install MariaDB

1 sudo apt-get install mariadb-server mariadb-client


Masukkan password user root database

Ulangi password

Uji coba login ke MariaDB

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

Pilih saja apache2, nanti dikonfigurasi agar terhubung ke nginx


Masukkan password database administrative user

Masukkan password untuk phpMyAdmin

Ulangi password

Buat link agar terhubung ke folder nginx

1 sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/html


Uji coba masuk ke phpMyadmin, http://localhost/phpmyadmin

You might also like