Debian 8 instalacija LEMP servisa

Debian 8 instalcija LEMP servisa

Kako podesiti LEMP Akronim LEMP označava skup servisa u ovom slučaju na linux operativnom sistemu,    L – Linux ( Debian 8 ),    E – Nginx,    MMySQL,    Pphp.

Vaša IP Adresa:

ifconfig eth0 | grep inet | awk '{ print $2 }'

Primer ispisa:

addr: 192.168.0.23

Ažurirajte Vaš sistem

sudo apt-get update

MySQL instalacija

sudo apt-get install mysql-server

Tokom instalacije unesite Vašu root šifru.

sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation

Nema potrebe da menjate Vašu sifru koju ste postavili u prethodnom koraku. Na ostala pitanja radi jednostavnosti odgovorite sa Yes.

Nginx instalacija

sudo apt-get install nginx
sudo service nginx start

Konfiguracija

sudo vim /etc/nginx/sites-available/default
[...]
server {
        listen   80;
     

        root /usr/share/nginx/www;
        index index.php index.html index.htm;

        server_name wpaurora.com;

        location / {
                try_files $uri $uri/ /index.html;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                
        }

}
[...]

PHP instalacija

apt-get install php5 php-pear php5-mysql

Konfiguracija

sudo vim /etc/php5/fpm/php.ini
cgi.fix_pathinfo=1 i zameniti 1 sa 0.
sudo vim /etc/php5/fpm/pool.d/www.conf

Zamena linije listen = 127.0.0.1:9000 u lsiten = /var/run/php5-fpm.sock.

Restart php-a

sudo service php5-fpm restart

Kreiranje fajla info.php:

sudo vim /usr/share/nginx/www/info.php
sudo service nginx restart

Testiranje instalacije:

192.168.0.23/info.php

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.