Professional Documents
Culture Documents
##NGINX Installation:
sudo apt update
sudo apt upgrade
sudo apt install nginx -y
sudo systemctl status nginx
sudo systemctl disable --now apache2
sudo ufw status
##NGINX Configuration:
====================
sudo mkdir /var/www/domain_name
sudo chown -R $USER:$USER /var/www/domain_name
sudo vi /etc/nginx/sites-available/domain_name
server {
listen 80;
server_name domain_name www.domain_name;
root /var/www/domain_name/public;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
##MySQL Configuration:
====================
CREATE DATABASE db_name;
CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'db_password';
GRANT ALL PRIVILEGES ON * . * TO 'db_user'@'localhost';
FLUSH PRIVILEGES;
##Composer Installation:
======================
sudo apt install unzip
curl -sS https://getcomposer.org/installer -o composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
Certificate location:
/etc/letsencrypt/live/domain_name/fullchain.pem
/etc/letsencrypt/live/domain_name/fullchain.pem