Search This Blog

Wednesday, 1 November 2017

Creating SSL self signed key and certificate for apache webserver.

Use below single command to create SSL self signed certificate and key.


openssl req  -nodes -new -x509  -keyout yum.prod.example.lan.key -out yum.prod.example.lan.cert


Once created, this certificates can be used in ssl.conf like below.


NameVirtualHost *:443


ServerAdmin unixadmin@example.com.sa
ServerName yum.prod.example.lan
SSLEngine on
SSLCertificateFile /etc/httpd/certificate/yum.prod.example.lan.cert
SSLCertificateKeyFile /etc/httpd/certificate/yum.prod.example.lan.key
CustomLog  /var/log/httpd/yum_access_ssl.log combined
ServerAlias yum
DocumentRoot /apps/yum
"
        Options Indexes FollowSymLinks MultiViews




Restart httpd
Now you can access the link using https://yum.prod.example.lan

No comments:

Post a Comment