To move all files & folders from one destination to another:
mv /path/sourcefolder/* /path/destinationfolder/
To move All files & Folder of current:
mv * /path/destinationfolder/
To move single File:
mv filename.zip /path/destinationfolder/
To move all files & folders from one destination to another:
mv /path/sourcefolder/* /path/destinationfolder/
To move All files & Folder of current:
mv * /path/destinationfolder/
To move single File:
mv filename.zip /path/destinationfolder/
scp /path/to/file username@servername/ip:/destination/folder/
scp /Volumes/HDD/yourfilename.zip root@ip/server:/var/www/yourdirectorypath/public
scp user@remote_server:/remote/path/FILENAME /local/path/FILENAME
Install PHP for Nginx with PHP-FPM:
sudo apt update
sudo apt install --no-install-recommends php8.1 [Apache HTTP server and its httpd process]
sudo apt-get install php8.1-fpm -y [For PHP-FPM works with nginx]
php -v
sudo apt-get install -y php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmath php8.1-imap
php -m
Check if PHP-FPM is running:
sudo systemctl status php8.1-fpm
Add PHP support to Nginx:
sudo nano /etc/nginx/sites-available/default
Enable PHP in Nginx’s config file:
server {
# Example PHP Nginx FPM config file
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to setup Nginx, PHP & PHP-FPM config
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
# pass PHP scripts on Nginx to FastCGI (PHP-FPM) server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# Nginx php-fpm sock config:
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
# Nginx php-cgi config :
# Nginx PHP fastcgi_pass 127.0.0.1:9000;
}
# deny access to Apache .htaccess on Nginx with PHP,
# if Apache and Nginx document roots concur
location ~ /\.ht {
deny all;
}
} # End of PHP FPM Nginx config example
sudo nginx -t
sudo systemctl restart nginx
Installing MySQL:
sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service
Configuring MySQL:
sudo mysql_secure_installation
Creating a Dedicated MySQL User and Granting Privileges:
sudo mysql
mysql -u root -p
CREATE USER 'mailapp'@'localhost' IDENTIFIED WITH authentication_plugin BY 'password';
CREATE USER 'mailapp'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'mailapp'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
ALTER USER 'mailapp'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT on *.* TO 'mailapp'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'mailapp'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
mysql -u mailapp -p
Installing Certbot:
sudo apt install certbot python3-certbot-nginx
Confirming Nginx’s Configuration:
sudo nano /etc/nginx/sites-available/example.com
sudo nginx -t
sudo systemctl reload
Allowing HTTPS Through the Firewall:
sudo ufw status
sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP'
sudo ufw status
Obtaining an SSL Certificate:
sudo certbot --nginx -d example.com -d www.example.com
Verifying Certbot Auto-Renewal:
sudo systemctl status certbot.timer
sudo certbot renew --dry-run
=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...