flavoured by: https://www.linuxbabe.com/linux-server/install-nginx-mariadb-php7-lemp-stack-ubuntu-16-04-lts
Raspberry Pi 3 ; Ubuntu MATE for Raspberry Pi 3 ; ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz
sudo su
su
apt update
apt upgrade
apt install nginx
systemctl start nginx
systemctl status nginx
//systemctl enable nginx
apt install mariadb-server mariadb-client
systemctl start mysql
systemctl status mysql
systemctl enable mysql
sudo mysql_secure_installation
apt install php7.0-fpm php7.0-mbstring php7.0-xml php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl
systemctl start php7.0-fpm
systemctl enable php7.0-fpm
nano /etc/nginx/conf.d/default.conf
server {
listen 80;
listen [::]:80;
server_name <IP> YOUR SERVER <IP>;
root /usr/share/nginx/html/;
index index.php index.html index.htm ;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
}
location ~ /\.ht {
deny all;
}
}
rm /etc/nginx/sites-enabled/default
nginx -t
systemctl reload nginx
php --version
nano /usr/share/nginx/html/test.php
<?php phpinfo(); ?>
<IP> YOUR SERVER <IP>/test.php
For your server’s security, you should delete test.php file now.
reach me via derbarti gmail com