Youtube Playlist Link
apt update && apt upgrade
apt install nginx
apt install mariadb-server
mysql_secure_installation
apt install php-fpm php-mysql
php -v
service php{version}-fpm status
apt update && apt upgrade
add-apt-repository ppa:ondrej/php
apt update && apt upgrade
apt install php8.2
php -v
service php{version}-fpm status
apt-get install php8-cli php-common php-zip php-gd php-mbstring php-curl php-xml php-bcmath
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
adduser username
su username
cat ~/.ssh/id_rsa.pub
nano ~/.ssh/authorized_keys
Now you can log in to your server
nano /etc/nginx/nginx.conf
nano /etc/php/8.2/fpm/pool.d/www.conf
apt install git
git config --global user.name "username"
git config --global user.email "your@email.com"
nano /etc/nginx/sites-enabled/site-name
server {
root /yourproject-path;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
listen [::]:80;
}
nginx -t
apt install certbot python3-certbot-nginx
certbot --nginx -d example.com -d www.example.com