Board index Linux Apache

Moderator: chandranjoy

Apache self signed certificate HOWTO?

Postby chandranjoy » Sat Jan 14, 2012 1:12 pm

Apache self signed certificate HOWTO?

Generate the keys for the Certificate Authority (the key that will do the signing)
Code: Select all
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt

Generate the private key for your server
Code: Select all
openssl genrsa -des3 -out server.key 4096

Create a CSR (certificate signing request) to get signed by the CA
Code: Select all
openssl req -new -key server.key -out server.csr

Sign your csr with the key you made in the first step
Code: Select all
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt

Optionally remove the password from your key (if you do this protect your key!!!)
Code: Select all
openssl rsa -in server.key -out server.key.nopass

Add these lines to your Apache config(/etc/apache2/apache2.conf OR /etc/httpd/conf/httpd.conf)
Code: Select all
SSLEngine on
SSLCertificateFile    /www/ssl.crt/server.crt
SSLCertificateKeyFile /www/ssl.key/server.key



Good luck :)
Site Admin
Posts: 283
Joined: Fri Oct 23, 2009 11:19 pm

Return to Apache

Who is online

Users browsing this forum: No registered users and 1 guest