Learning Horizon | For Learners

ASP.NET, SQL SERVER, JQUERY,JAVASCRIPT, WEBSPHERE

Sunday, 21 April 2019

Install Self-Signed Certificate In Apache Server On Linux

In this tutorial today, we will learn about how to install self-signed certificate in Apache server on Linux machine. First, before starting the activity you need to make sure that all below mentioned pre-requisites are already installed on Linux system. I’ve used RedHat Enterprise Linux 7 vm (virtual machine) for this purpose.

Pre-Requisites: -

  1. Make sure mod_ssl is installed

    If above packages are not installed on your system already, please install them before further proceedings with the help of below command.
    yum install mod_ssl

    To check mod_ssl is installed or not please use below command
    rpm -qa | grep -i mod_ssl

  2. Make sure that port 443 is open. By default, it is closed so you need use below mentioned command to open this port.
    firewall-cmd --zone=public --add-port=443/tcp –permanent

  3. Make sure that you have loaded the mod_ssl module in httpd.conf file
    LoadModule ssl_module modules/mod_ssl.so

Procedure: -


Below are the steps to install self-signed certificate.
  1. Go to the following path.
    cd /etc/httpd/conf.d

  2. Type ls command on your terminal and you will see a ssl.conf file in which you need to make some modifications.

  3. Open this (ssl.conf) file in your terminal with the help of vi command.
    vi ssl.conf

  4. Search/Locate <VirtuaHost_default_:443> and add/set below values. <VirtualHost _default_:443>
    ServerAdmin admin@demosite.com
    ServerName www.demosite.com
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/demosite.com.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/demosite.com.key
    </VirtualHost>

    After saving all modifications restart Apache server by using service httpd restart command.

No comments:

Post a Comment

Please do not enter spam links.