Want to know how to install an SSL certificate on Apache2 Ubuntu Server? We shared an easy working guide.
Apache server Is one of the leading web servers in the world. Apache is open-source software, and many people are regularly working to maintain/upgrade it for the betterment of the online community.
Apache web server is considered as one of the leading powerhouses fueling the sites on the internet; we are so used to regularly visiting in today’s online world. This server is mostly hosted on various flavors of Linux operating systems.
Ubuntu is a Linux-based operating system that has gained a lot of popularity since its inception. It gets regular updates every six months. Ubuntu supports the installation of the Apache server to give you the best open-source combination.
Here are the advantages of Apache2 Ubuntu server:
- Free of cost
- No need for a license
- Highly efficient and reliable server
- Easy installation
- Can be modified for optimum usage
- Changes are applied quickly with no need of restarting the server
- Gets regular updates
As with any software offering, the Apache2 Ubuntu server also needs to be defended against online businesses’ increasing cyber-attacks. You must adopt the use of an SSL certificate on the Apache2 Ubuntu server to make it safe and reliable.
SSL certificates are serving the world with their outstanding performances in protecting web servers and online consumers. Almost all online businesses use them in the world to provide standard security against cyber-criminals.
Let us go through the basics of SSL certificates and how to install an SSL certificate on the Ubuntu server.
What is an SSL Certificate?
A Secure Sockets Layer (SSL) or Transport Layers Security (TLS) is a mainstream security system that protects your website’s communication and the customers visiting your site. It encrypts data exchange between two engaging parties to make it impossible for cybercriminals to access it.
Suppose you neglect the security of your Apache2 Ubuntu server. In that case, the resources of your website and your client’s sensitive information (usernames, passwords, credit card details) can be easily accessed by ill-meaning hackers, who are always in search of unprotected sites.
Of course, you would not like to put your site and your customers in trouble.
To avoid this situation, you must deploy an SSL certificate on your Apache2 Ubuntu server.
Guide to Generate CSR in Apache2 Ubuntu Server?
You need to make a certificate signing request in an Ubuntu server using Apache2 to complete the process of SSL installation. Follow the procedure described below to generate CSR in Ubuntu:
1. Log in to your server using Secure Shell (SHH)
2. Enter the command mentioned below at the prompt
“openssl req -new -newkey rsa:2048 -nodes -keyout mydomain.key -out mydomain.csr“
3. Change “mydomain” to your real domain name.
4. You would need to answer some questions as elaborated below:
- Country – Here, you need to provide the two-letter abbreviation of your country, such as the US, for the United States.
- State or Province – The state or region from where your firm is working.
- City Name – Full name of the city where your company is located. Avoid using abbreviations.
- Company Name – The legal title of your corporate. If you send your request for an SSL certificate as a person, then use your name instead.
- Administrative Unit Name – If you have applied as a company, enter the “business field or administrative unit” name here. If submitted as an individual, write the department name.
- Public Name – A fully qualified domain name (FQDN) for which you are buying an SSL certificate.
- Email Address – A correct electronic mail address to communicate with you.
- Test Password – This is an optional step to make your certificate more secure. You can use or leave this step.
- An Elective Firm Name – This is another elective step to provide your company name.
5. By completing these steps, your CSR will be generated.
6. You can find the CSR file by typing the “Is” command. You will see the .key file that should be kept secret on your server and the .csr file sent to the certification authority.
Install SSL Certificate on Apache2 Ubuntu Server
After generating a certificate signing request on the Apache2 Ubuntu server, apply for an SSL certificate. Provide the required information to the certification authority and follow the simple method laid down below for installation:
#1. The certification authority will validate your information and will issue your SSL certificate. They may send the license in the form of a zip file through email. The zip file will have primary, intermediate, and root certificates files in it. Download and extract that zip file on your server where you want to keep all certificates files.
#2. You can find the Apache configuration file on Apache2 Ubuntu server in:
In case you are unable to locate the config file then type the following code in the command:
sudo a2ensite Domain_name
#3. Open the Apache configuration file in a text editor and search for the Apache Setting block.
#4. If you want to access your site with both secure (HTTPS) and non-secure (HTTP) connections, then you require two different “/etc/apache2/sites-enabled/Domain_name” files -one for port 80 and one for port 443, respectively.
#5. Now, use the following piece of code to configure
- SSLCertificateFile refers to the Primary SSL Certificate file.
- SSLCertificateKeyFile corresponds to the Private Key file which you received during the process of producing CSR.
- SSLCertificateChainFile mentions the Intermediate Certificate file received from your SSL certificate issuing authority.
Now, restart Apache and SSL certificate is installed on your Apache2 Ubuntu Server.
Apache2, when installed on Ubuntu, provides you a faster and flexible web surfing experience.
Apache is an excellent open-source HTTP server – it is however not secure to host your website on it without first adding more protection.
You need to install an SSL certificate on this server to protect all your hosted sites on this webserver. You can easily install an SSL certificate on Apache2 Ubuntu server by taking a clue from the steps mentioned above. This will ensure the protection of your website and your customers from online miscreants.
Other Installation Help;