While many web hosting providers provide paid SSL certificate to your server, you can also install ssl certificate using command line by own.
Let’s Encrypt provides free SSL certificate. You can simply install SSL certificate using any software clients.
In this article, we will use Certbot software client to install free SSL certificate for Apache on Ubuntu server. We will set certificate renewal automatically.
Note:
Before procedding to installation, make sure you have already installed Apache web server. You should also have your domain with A DNS records set to point your server ip address. You should be logged in to your server.
First of all, we need certbot software client installed on your server. To install it, run the bellow command.
sudo apt update
sudo apt install certbot python3-certbot-apache
Now you need to check and confirm your apache configuration for domain. Your apache default configuration file located at /etc/apache2/sites-enabled/000-default.conf
. Open the file in nano editor with below command.
sudo nano /etc/apache2/sites-enabled/000-default.conf
Now confirm you have set ServerName and ServerAlias to your domain.
...
ServerName laravelcode.com
ServerAlias www.laravelcode.com
...
Now we will proceed for certificate installation. Run the below command and it will start installation wizard with asking few questions.
sudo certbot --apache
First it will ask for email address. Input the email address where you want to receive all certificate related mails and continue with ENTER.
Next it will ask to accept Terms of Service. You can accept it by pressing A
and then hit ENTER.
Now it will ask your email to subscribe Electronic Frontier Foundation. You can simply press Y
for Yes or N
for No and hit ENTER.
In the next step, it will ask your domains to activate for https. You can select domains with comma seperated or leave blank to select all domain and hit ENTER.
This will print below line of certification create.
In the last step, it will ask whether you want to forcefully redirect http traffic to https or not. Select 2 option to enable the redirection and press ENTER.
You will see successfully installation message.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://laravelcode.com and
https://www.laravelcode.com
...
Now you can open your website using https://
in the new browser tab. If you see green indicator, it means the certificate is installed successfully to your server. The certbot will automatically renew certificate before it expires.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to Trigger a Click on a Link Using jQuery
Use the jQuery click() Method You can...How to set default application to open files in FileZilla
FileZilla is a open-source multi-platfor...How to display all items or values in an array using loop in jQuery
Use the jQuery.each() function The jQ...How to get Minimum Value Key in Associative Array in PHP
Today we will share with you one simple...Create and Setup Symfony Project
Symfony is fast and leading PHP framewor...