Website Hosting & SSL certificate installation

From Apoyar Wiki
Revision as of 12:48, 28 December 2020 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Website Hosting

Login to Go Daddy account (https://dcc.godaddy.com/manage/apoyar.eu/dns) with corresponding domain

Create DNS record

• Type – A

• Host – Project Name (websitetesting)

• Point to – Server IP (On which, we are hosting website ex. demo.apoyar)

• Click on SAVE

Login to Server (ex. demo.apoyar)

Go to below path and copy the config file from existing project config file

• Cd /etc/nginx/sites-available

Open config file and edit the servername (ex. demo.apoyar) and path (/var/www/websitetesting)

• Vi websitetesting.conf

Go to below path and create folder (websitetesting) and create index.html file inside that folder with some content

• mkdir websitetesting

• vi index.html


Create softlink with below command

• ln –s /etc/nginx/sites-available/websitetesting.conf /etc/nginx/sites-enabled

Reload nginx service with below command

• service nginx reload


SSL Certificate Installation

Go to https://certbot.eff.org We have to select there, web server and corresponding system Ex. Nginx (webserver) and Ubuntu 18.04 (system)

Install the certificate with below command • sudo certbot –nginx

It will give you a list of projects, to select your project, enter according project number and press enter

Then it will ask for redirection with two options, we have to select 2nd option • Redirect all This way the certificate get installed Then check the website with the secured one

With other option we can just generate certificate with below command, then we have to change only key file path in the config file • sudo certbot certonly --nginx

Example: Below two lines need to replace

   ssl_certificate /etc/letsencrypt/live/websitetesting.apoyar.eu/fullchain.pem; # managed by Certbot
   ssl_certificate_key /etc/letsencrypt/live/websitetesting.apoyar.eu/privkey.pem; # managed by Certbot

Errors:- 1.If certificate not installing due to the domain mistake or domain not created in GoDaddy, Nginx configuration file mistake with a domain name.

        2.As well as after installation is done and still SSL is not secured then rerun it again to fix that.