shubham-kumar-tripathi / learning-dev-ops

This is my progress tracker in learning dev-ops
0 stars 0 forks source link

Setup a cloud virtual machine in any cloud vm provider #1

Open shubham-kumar-tripathi opened 1 year ago

shubham-kumar-tripathi commented 1 year ago
shubham-kumar-tripathi commented 1 year ago

---AWS ---Azure --- Google Cloud

--- Web Server Name. --- OS Image. --- Instance type. --- RSA Pair Login Key using .pem file.

--- Using OpenSSH, and --- RSA Pair Login Key using .pem file.

--- After Installing NGINX, enable the firewall and enable Port 80 and Port 443. --- Then Copied the Website's Source Code from the Local Machine to the Virtual Machine using "scp - Secure Copy Protocol" by creating a tunnel between the local machine and the virtual machine using OpenSSH and Pair login key from Local Machine Port 2222 to the Virtual machine Port 22. --- Then moved those files to

  $   mv  WeatherApp_Files   /var/www/WeatherApp(Created a Directory)/

--- Then deleted the default file in the Site-Available Directory by

 $   sudo rm /etc/nginx/sites-available/default

--- Then deleted the default file in the Site-Enabled Directory by

 $   sudo rm /etc/nginx/sites-enabled/default

--- Then created a file in the directory Site-Available: WeatherApp_Site and pasted this script

 $   nano  /etc/nginx/sites-available/WeatherApp_Site

and pasted this script:

  server {
     root /var/www/WeatherApp;
     index index.html;
     server_name WeatherApp Server www.aalsiaadmi.systems;
     location / {
         try_files $uri $uri/ =404;
     }
  }

--- And then created a Softlink of that Site-Available( _/etc/nginx/sites-available/WeatherAppSite ) file in the Site-Enabled Folder.

    $   ln -s /etc/nginx/sites-available/WeatherApp_Site   /etc/nginx/sites-enabled/WeatherApp_Site

--- Then restart your NGINX.

    $   sudo systemctl restart nginx

--- By Creating two Records in Manage DNS in Name.com's Dashboard

--- Installed Certbot. (It fetches an SSL certificate from let's encrypt) ---https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal

 $   sudo snap install --classic certbot

--- Prepare the Certbot command

 $   sudo ln -s /snap/bin/certbot /usr/bin/certbot

--- Then installed Certificate from Certbot.

 $   sudo certbot --nginx

--- Test automatic renewal

 $   sudo certbot renew --dry-run

aalsiaadmi.systems is up and running.