Monday, August 29, 2022

How to install NGINX and configure on Ubuntu 20.04

sudo apt-get update

sudo apt upgrade

sudo apt install nginx

sudo systemctl status nginx

sudo ufw allow http

sudo ufw reload


sudo systemctl status nginx

sudo systemctl stop nginx

sudo systemctl start nginx


sudo systemctl disable nginx

sudo systemctl enable nginx

sudo systemctl restart nginx

sudo systemctl reload nginx



sudo unlink /etc/nginx/sites-enabled/default

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

sudo nginx -t

sudo systemctl restart nginx

sudo mkdir /var/www/example.com

How to unzip tar.gz file in linux

sudo apt-get install zip

unzip file.zip -d destination_folder

unzip file.zip

tar -xf archive.tar.gz

Sunday, August 28, 2022

How To Set Up Nginx Virtual Hosts Server Blocks on Ubuntu 20.04

Follow the steps to Set Up Nginx Virtual Hosts Server Blocks on Ubuntu 20.04:


 1. Create New Document Root Directory


sudo mkdir -p /var/www/yourdomain.com/public

sudo chown -R $USER:$USER /var/www/yourdomain.com/public

sudo chmod -R 755 /var/www


2. Creating Pages

nano /var/www/yourdomain.com/public/index.html



3.Creating new site available or server block copied from existing/default domain:

sudo cp /etc/nginx/sites-available/defaultdomain.com /etc/nginx/sites-available/yourdomain.com


4.  Enabling  Server Blocks and Restart Nginx

sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/


5. Restart Nginx

sudo nginx -t

sudo systemctl restart nginx


6. Modify Local hosts file (optional)

sudo nano /etc/hosts


203.0.113.5 yourdomain.com www.yourdomain.com


7. Test website

https://easy2move.fr


Saturday, August 27, 2022

How to Enable SSH Keys Authentication

 cd /etc/ssh

sudo nano sshd_config

Uncomment the following lines

PubkeyAuthentication yes

AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

Save & exit.


You can follow this topic also:

Fix ssh port 22 connection refused ubuntu

How to create authorized_keys file in linux with ssh folder

How to create authorized_keys file in linux with ssh folder

 ls -a | grep .ssh

mkdir ~/.ssh/

touch ~/.ssh/authorized_keys

sudo nano ~/.ssh/authorized_keys

Fix ssh port 22 connection refused ubuntu

sudo apt install openssh-server

sudo apt list --installed | grep openssh-server

sudo service ssh status

sudo service ssh start

sudo service ssh restart

ssh [username]@[remoteserver IP or hostname]

ssh -p [port_number] [username]@[ip_address]

sudo netstat -ltnp | grep sshd

ssh -p [2244] [username]@[ip_address]

sudo ufw allow port /tcp

sudo ufw allow 2244/tcp

sudo ufw reload

sudo ufw status

sudo apt install arping

ping <ip-address>

Thursday, August 25, 2022

How to add public key to authorized_keys ec2 instance Ubunutu Linux

 Step 1: Login into you AWS account and go to EC2 instances

Step 2: Select your instance and click connect

Step 2: Then click connect button at the bottom right corner

Step 3: Now a new tab will be opened with console as follows

Step 4: Copy your SSH public key then add the key to the following key file

Use this command in Mac/Windows powershell to copy your public key: pbcopy ~/.ssh/id_rsa.pub

nano ~/.ssh/authorized_keys

Step 5: Save and reboot then try to connect again with device from which public key generated.

How to get Ranking of the Students in Excel using RANK Function

=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...