Thursday, July 15, 2021

Create a SSL Certificate on Nginx for Ubuntu

1.  create ssl folder

sudo mkdir /etc/nginx/ssl

 

 

 2. go to nginx /ssl folder using below command

cd /etc/nginx/ssl
 
3.
The first file that we need to create is the private key. While creating the key, we will be asked for a passphrase. We must make sure to remember the passphrase since we will not be able to access the certificate without it.
 
 sudo openssl genrsa -des3 -out server.key 1024
 

 4.
Once we have the key created, we will use the key on order to create Certificate Signing Request.
 
5.We have to run below command to create certification
sudo openssl req -new -key server.key -out server.csr 
It will ask your old pass pharse value and Company Name,City like wise Questions.
you may refer screenshot.

 
6.If we have a passphrase it has to be typed in manually, so if there is not person available to do it, the website will be offline for a long time. That is why we are going to remove the passphrase from the key file, using the following command 
# sudo cp server.key server.key.org
# sudo openssl rsa -in server.key.org -out server.key
 

 
7.Now we are ready to create and sign our certificate by below command
 sudo openssl x509 -req -days 365 -in server.csr -signkey server.key 

 8.
It will be valid for 1 year (365 days). That is something that can be 
changed if needed. Now we can use the certificate and assign to a 
virtual host. We can copy the Nginx sample configuration file in a new 
file and use that.
 
9.most important part to be change are as follows
server {
  listen 443;
  server_name our-domain.com;

  root /var/www;
  index index.html index.htm;

  ssl on;
  ssl_certificate /etc/nginx/ssl/server.crt;
  ssl_certificate_key /etc/nginx/ssl/server.key;
} 
 

After making the changes and saving the file, we should copy the virtual host configuration file into /etc/nginx/sites-enabled/default file.

Before change it ,please take a backup of it.

and then restart Nginx.

# sudo service nginx restart
  

Install Intellij IDEA IDE on Ubuntu 18.04

 1. go to https://www.jetbrains.com/idea/download/#section=linux 

and Download Linux version Community one.

you may refer screenshot.



2. go to download ideaIC-2019.1.4.tar.gz file and run the below command

sudo tar -zxvf ideaIC-2019.1.4.tar.gz -C /opt/

3. go to install location

cd /opt/idea-IC-191.8026.42/bin/


4. run the below command

./idea.sh


5. you will received below popup window and continue rest of the installation process.


6. Now your installation process completed 



 




Tuesday, July 6, 2021

setup react js on ubuntu 18

 1. run the below command to install nodejs


sudo apt install nodejs
 
2. run the below command to install npm (node package manager)
 
sudo apt install npm

 
3.  Next install Visual Studio code with below commands
 
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - 
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" 
 sudo apt install code
 
4. After that open Visual STudio Code IDE
Then Add Simple React Snippets  Extension
5. Then Add Prettier
Extension
 

 Now you can run reactjs project on your Ubuntu machine.Good luck