Cài đặt LEMPP trên Ubuntu
sudo apt update
sudo apt install nginx
Kiểm tra bằng cách truy cập vào
http://server_domain_or_IP
nếu trả về status code là 200 là
sudo apt install mysql-server
sudo mysql_secure_installation
# => thực hiện các step tiếp theo đển hoàn tất cài đặt
sudo apt install php-fpm php-mysql
sudo nano /etc/nginx/sites-available/default
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/
sudo systemctl reload nginx
Source code đặt tại
/var/www/html