Linux serverNETWORK ADMINISTRATIONS

creating and installing self signed certificate for apache web server in centos 7

This tutorial will help you creating and installing self signed certificates for apache web server in centos7 or RHEL7.

Find below the required script to create certificates as described in the video.

======================================================
#!/bin/bash
mkdir /etc/httpd/ssl
cd /etc/httpd/ssl
echo -e “Enter your virtual host FQDN: n”
read cert
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out $cert.key
chmod 600 $cert.key
openssl req -new -key $cert.key -out $cert.csr
openssl x509 -req -days 365 -in $cert.csr -signkey $cert.key -out $cert.crt
echo -e ” The Certificate and Key file for $cert has been generated!n”
ls -al /etc/httpd/ssl
exit 0
======================================================

source

centos 7

2 thoughts on “creating and installing self signed certificate for apache web server in centos 7

  • Its good but explain what ur script and the command was doing…would have been helpful if u could explain csr key and crt as well

Comments are closed.