Friday, February 22, 2019

Creating Self-Signed Certificates for the Apache Web Server

Use the OpenSSL package.  Issue the following commands in the Linux terminal:

# openssl req -new > ca.csr

# openssl rsa -in privkey.pem -out ca.key

# openssl x509 -in ca.csr -out ca.crt -req -signkey ca.key -days 720

These commands creates the SSL certificates good for 720 days with the files ca.csr, ca.crt, and ca.key.  Copy these files to the SSL directory of your Apache web server.  In my Linux system, this is located in /etc/apache2/ssl

# cp ca.* /etc/apache2/ssl

Then, restart the Apache webserver for the new certificates to take effect.

# service apache2 restart

No comments: