Apache self-signet certificate

Step 1: Generate a Private Key

openssl genrsa -des3 -out server.key 1024

Step 2: Generate a CSR (Certificate Signing Request)

openssl req -new -key server.key -out server.csr

Step 3: Remove Passphrase from Key

cp server.key server.key.org

openssl rsa -in server.key.org -out server.key

Step 4: Generating a Self-Signed Certificate

openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt

Step 5: Installing the Private Key and Certificate

cp server.crt /etc/apache2/ssl/
cp server.key /etc/apache2/ssl/

Step 6: Configuring SSL Enabled Virtual Hosts

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl//server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Step 7: Restart Apache and Test

/etc/init.d/apache2 stop
/etc/init.d/apache2 stop

https://test.site.com

Leave a Reply