How to Install SSL Certificate in Linux Apache




Apache is an open source web server developed by the Apache Foundation and has been successfully implemented in most web servers around the world. Protocol HTTP with port 80 is already very common. The barriers are, in this Protocol is the transaction data is not dienkrip. This causes the HTTP protocol may be security gaps in a system. To this end, the authors make a Tutorial How to create a SSL certificate on APache with Ubuntu at 14 as the operating system. This is because HTTPs protocol can encrypt data being transacted on this Protocol. HTTPS uses port 443 on its own.

SSL Certificate or SSL certificate itself is a method to encrypt the data passing by on a site or host (because it is not only used for Https Protocol only), thus making the security level on the transaction data is increasing. SSL certificates can also display the identity of the service provider, this may convince them to open up and transaction data on the host or site.



To perform the following steps-steps, you are required to have a user account or a user who has administrative rights or a minimum entry in sudoers. If you have not installed the apache, then run the following command:
sudo apt-get install apache2

Then turn on or enable SSL on apache module by entering commands on your linux terminal.
sudo a2enmod ssl

After that proceed with restarting apache, type the following commands on your terminal
sudo service apache2 restart

The next step, create a directory. On the directory that we will store the SSL certificate and key which we will use later.
sudo mkdir /etc/apache2/ssl

Then we will create an SSL certificate we sign it yourself. At the time of this move, we can set when the certificate is expired or will expire. You can change the number 365 that indicates how many days this certificate will be valid. The following command (command) making an SSL certificate:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

With the above command we already make SSL certificate we sign itself along with its key to protect the certificate. This command will prompt you to enter correct data – data. The most important Common Name is filled in.

The next step, we will configure the SSL Certificate. We open the SSL config file:
nano /etc/apache2/sites-available/default-ssl

Locate the section that starts with < VirtualHost_default: 443 >, then add the following line:
ServerName mydomain.com:443

Replace this with mydomain.com hostnames or domains that are already registered or you want to use. If this is a local server, the IP address can also be used to replace mydomain.com. And find three lines of config it and adjust with the layout or the file path of the certificate and key earlier:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

Do not forget to save. Then enable virtual host that we have created.
sudo a2ensite default-ssl

You do not forget to open port 443 on the firewall in linux Ubuntu. Then the point is step restart apache2 service.
sudo service apache2 restart

So this tutorial may be beneficial for you

Next
Previous
Click here for Comments

0 comments: