SSL Certificate Installation of Apache2 Web Server

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

SSL Certificate Installation of Apache2 web server

1. Generating A CSR Key of concern domain :-

$ openssl req -new -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr

Replace the your domain name instead of mydomain.

2. Extract the ZIP file of SSL. Exp: ​yourDomainName.crt​ and ​yourDomainName.ca-bundle

3.Move both to the server.

4. Move the ​yourDomainName.crt​ and ​yourDomainName.ca-bundle​ to the ssl.crt directory,


which is typically found in the /etc/ssl/ directory.

5. Apache Configuration File:-

A.Fedora/CentOS/RHEL: /etc/httpd/conf/httpd.conf

B. Debian and Ubuntu based: /etc/apache2/apache2.conf

6. SSL Configuration File.

httpd-ssl.conf
ssl.conf
In the /etc/apache2/sites-enabled/ directory.

7. ​In the ​VirtualHost​​ section of the file please add these directives if they do not exist. It is best
to comment out what is already there and add the below entries.

1. SSLEngine​​ on
2. SSLCertificateKeyFile​​ /etc/ssl/ssl.key/server.key
3. SSLCertificateFile​​ /etc/ssl/ssl.crt/yourDomainName.crt
4. SSLCertificateChainFile​​ /etc/ssl/ssl.crt/yourDomainName.ca-bundle ***
8. Edit this Below line on /etc/httpd.conf OR /etc/apache2.conf

VirtualHost 192.168.0.1:​443​​>

DocumentRoot /var/www/website

ServerName www.domain.com

SSLEngine on

SSLCertificateFile /etc/ssl/crt/primary.crt

SSLCertificateKeyFile /etc/ssl/crt/private.key

SSLCertificateChainFile /etc/ssl/crt/intermediate.crt​​</VirtualHost>

9.Save the changes and exit the text editor.

10. Restart the Apache Web Server.

$ systemctl restart apache2 (For Debian)

$ systemctl restart httpd (For RHEL Based)

You might also like