1. Enable the SSL module
- sudo a2enmod SSL
2. Installing OpenSSL
- sudo apt-get install OpenSSL
3. Create a CA signature (do not use the password removal-des3 option)
- OpenSSL genrsa-des3-out Server.key 1024
4. Create a CSR (Certificate Signing Request)
- OpenSSL Req-new-key server.key-out SERVER.CSR
5. Self-issued certificate
- OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt
6. Copy to the appropriate directory
- sudo cp server.crt/etc/ssl/certs
- sudo cp server.key/etc/ssl/private
7. Modify the configuration file
- sudo cp/etc/apache2/sites-enabled/000-default/etc/apache2/sites-enabled/001-ssl
- sudo vim 001-ssl
In the <virtualhost *:80> section, add content below the DocumentRoot line:
- Sslengine on
- Ssloptions +strictrequire
- Sslcertificatefile/etc/ssl/certs/server.crt
- Sslcertificatekeyfile/etc/ssl/private/server.key
Port modified to: 443, <virtualhost *:443> (SSL port)
8. Restart Apache
- Sudo/etc/init.d/apache2 Force-reload
- Sudo/etc/init.d/apache2 restart
An easy way to configure SSL for Apache under Ubuntu (Implementation of HTTPS)