Open hmjrun opened 7 years ago
sudo apt-get update
sudo apt-get install nginx
# 1. /etc/nginx/sites-available/default-php.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
# 2. Test your configuration file for syntax errors by typing:
sudo nginx -t
# 3. buit soft link conf file to nginx sites-enabled
sudo ln -s /etc/nginx/sites-available/default-php.conf /etc/nginx/sites-enabled
# 4. restart nginx
sudo service nginx restart
sudo apt-get install mysql-server
# install PHP
sudo apt-get install php-fpm php-mysql
# change both of these conditions by uncommenting the line and setting it to "0"
sudo vim /etc/php/7.0/fpm/php.ini
cgi.fix_pathinfo=0
# restart our PHP processor
sudo systemctl restart php7.0-fpm
Introduction
The LNMP software stack is a group of software that can be used to serve dynamic web pages and web applications. This is an acronym that describes a Linux operating system, with an Nginx web server. The backend data is stored in the MySQL database and the dynamic processing is handled by PHP.
1. Prerequisites:Linux( Ubuntu 16.04 )