Thursday, May 27, 2010

Custom SSL certificate for Apache

  1. Generate a Private Key:
  2. openssl genrsa -des3 -out server.key 1024
  3. Generate a CSR (Certificate Signing Request):
  4. openssl req -new -key server.key -out server.csr
  5. Remove Passphrase from Key:
  6. cp server.key server.key.org openssl rsa -in server.key.org -out server.key
  7. Generate a Self-Signed Certificate for 5 years:
  8. openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
  9. Installing the Private Key and Certificate:
  10. cp server.crt /usr/local/apache/conf/ssl.crt cp server.key /usr/local/apache/conf/ssl.key
  11. Configuring SSL Enabled Virtual Hosts in Apache:
  12. SSLEngine on SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key

No comments:

Post a Comment