Configure self signed SSL certificate

Configure self signed SSl certificate for Apache running on CentOS 6.x

# Install required packages
yum install mod_ssl openssl

# Generate private key
openssl genrsa -out 2048

# Generate CSR
openssl req -new -key -out

# Generate Self Signed Key – valid for 3 years
openssl x509 -req -days 1095 -in -signkey -out

# If not exists, create following folder
mkdir -p /etc/httpd/ssl

# Copy certificate files to the directory
cp /etc/httpd/ssl/
cp /etc/httpd/ssl/
cp /etc/httpd/ssl/

# Update following two lines in /etc/httpd/config.d/ssl.conf
SSLCertificateFile /etc/httpd/ssl/
SSLCertificateKeyFile /etc/httpd/ssl/

# Restart web server
service httpd restart


Leave a Reply

Your email address will not be published. Required fields are marked *