Install LEMP ( NGINX dan PHP dan MariaDB )di Debian 7

Install debian 7 seperti biasa......

1: Ubah repo ke Kambing
buka file /etc/apat/source.list

deb http://kambing.ui.ac.id/debian/ wheezy main
deb-src http://kambing.ui.ac.id/debian/ wheezy main
deb http://kambing.ui.ac.id/debian/ wheezy-updates main
deb-src http://kambing.ui.ac.id/debian/ wheezy-updates main
deb http://kambing.ui.ac.id/debian-security/ wheezy/updates main contrib non-free
deb-src http://kambing.ui.ac.id/debian-security/ wheezy/updates main contrib non-free
 
2: Tambahkan repo DotDEB Kambing
# mirror DOTDEB Kambing NGINX
deb http://kambing.ui.ac.id/dotdeb/ wheezy all
deb-src http://kambing.ui.ac.id/dotdeb/ wheezy all

# PHP 5.4
# mirror DOTDEB Kambing UI untuk PHP 5.4
deb http://kambing.ui.ac.id/dotdeb/ squeeze-php54 all
deb-src http://kambing.ui.ac.id/dotdeb/ squeeze-php54 all

# PHP 5.5 
# mirror DOTDEB Kambing UI untuk PHP 5.5
#deb http://kambing.ui.ac.id/dotdeb/ wheezy-php55 all
#deb-src http://kambing.ui.ac.id/dotdeb/ wheezy-php55 all

# PHP 5.6
# mirror DOTDEB Kambing UI untuk PHP 5.6
#deb http://kambing.ui.ac.id/dotdeb/ wheezy-php56 all
#deb-src http://kambing.ui.ac.id/dotdeb/ wheezy-php56 all 

3: Fetch dan install the GnuPG key
wget http://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg


4: Tambahkan repo MariaDB Biznet
sudo apt-get install python-software-properties
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mariadb.biz.net.id//repo/10.0/debian wheezy main'
 
sudo apt-get update
sudo apt-get upgrade 
 
5: Hapus Apache and Install Nginx Web server 
 
apt-get purge apache*
rm -rf /etc/apache2 
 
apt-get install nginx 

Edit file /etc/nginx/sites-available/default
server {
 listen 80 default_server;
 
 root /var/www/;

 # Add index.php to the list if you are using PHP
 index index.php index.html index.htm index.nginx-debian.html;

 server_name cardtech.dev;

 location / {
  try_files $uri $uri/ /index.php;
 }
location /repo {
  index  index.html  index.php  /_h5ai/server/php/index.php;
 }

#pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;


}

6: Install MariaDB
apt-get install mariadb-server
Mengamankan instalasi MariaDB
root@www:~# mysql_secure_installation

7: Installasi dan Konfigurasi PHP
apt-get install php5-fpm php5-mysql
 
atau untuk install module for php5 (Native Driver)
apt-get install php5-fpm php5-mysqlnd 

edit file /etc/php5/fpm/php.ini  lalu cari cgi.fix_pathinfo=1 ganti menjadi 0
cgi.fix_pathinfo=0
 
Lalu restart NginX dan php-fpm 
service nginx restart
service php5-fpm restart
 
Cek semua sudah terisntall
root@www:~# php -v
root@www:~# mysql -V
root@www:~# nginx -v
 
bikin file info.php
nano /var/www/info.php

<?php phpinfo(); ?>
 
 
 

Komentar

Postingan populer dari blog ini

Cloudflared argo tunnel zero trust service on Mikrotik

Migrasi zimbra ke zimbra dengan rsync

Squid Proxy ssl bump untuk transparent HTTPS #2