Ubuntu based VPS server to host React Node JS projects with SSL | Varun Gupta


# First download Ubuntu 18.04 or use Any Cloud VPS.
(Download the OVF file from here) # Install Node Latest version $ sudo apt install curl $ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash – $ sudo apt install nodejs $ node -v ## Install command for other packages $ sudo apt install nginx $ sudo nginx $ cd /var/www $ sudo mkdir subdomain.example.com $ sudo touch subdomain.example . com/index.html ## For the domain subdomain.example.com $ sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/subdomain.example.com $ sudo ln -s /etc/ nginx /sites-available/subdomain.example.com /etc/nginx/sites-enabled/subdomain.example.com ## NOTE: There is only one default server block in nginx with the same port. ## For the server subdomain.example.com { listen 80; listens [::]:80; root /var/www/blog.example.com; index index.html; server_name blog.example.com; } # For SSL ## Change the available domain file server on the site { listen 443 ssl; server_name subdomain.example.com; } $ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install python-certbot-nginx $ certbot -d subdomain.domain.com –manual –preferred-challenges dns certonly # # Explained -d – pass the subdomain. –manual – manual authentication method. –preferred-challenges dns – Use the DNS authentication method. You must manually add the DNS value to verify that you own the subdomain. ## Generated in /etc/letsencrypt/live/subdomain.example.com/fullchain.pem; /etc/letsencrypt/live/subdomain.example.com/privkey.pem; ## Server Domain File Server { listen 443 ssl; listens [::]:443 ssl; root /var/www/subdomain.example.com; server_name subdomain.example.com; ssl_certificate /etc/letsencrypt/live/subdomain.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/subdomain.example.com/privkey.pem; } $ sudo nginx -t $ sudo service nginx restart Now the server with SSL and the hosted MERN project are up Thanks for looking. Comment if you have any doubt

Source Link



Crytocurrency,16,Deals/Offers,11,Digital Marketing & SEO,19,Education,25,Finance,117,Hosting,1604,Insurance,48,Loan,10,Mortgage,29,Reviews,29,Shopping,42,Software & Apps,1692,Trading,14,Travel,16,Web Development,23,
Viralrook: Ubuntu based VPS server to host React Node JS projects with SSL | Varun Gupta
Ubuntu based VPS server to host React Node JS projects with SSL | Varun Gupta
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content