Hi ! 🙂 This is the second part of SSL guide. After obtaining the keys you can followed up to installing the keys on apache and do the changes in the virtual hosts and test your web site with https.
Step 5: Copying the private key and the certificate to etc/apache2/ssl
Command: cp server.crt /etc/apache2/ssl/server.crt
Command: cp server.key /etc/apache2/ssl/server.key
Step 6: Configuring apache to use SSL
You will need to edit the ‘default-ssl’ configuration file which resides in etc/apache2/sites-avaiable directory.
- Change the ServerAdmin your_email, ServerName: domain_name or common_name, DocumentRoot: path to the web site content.
- Change the path to —> SSL certificate and server key
Step 7: Enable the default-ssl configuration
You can use following commands interchangeably while enabling the proper configuration on your server.
Check already enabled site settings:
Command: a2dissite
Disable site settings:
Command: sudo a2dissite default-ssl
Enable site settings:
Command: sudo a2ensite default-ssl
Each time you need to restart the server to apply the config changes:
Command: sudo service apache2 restart
Step 8: Testing the site with SSL on browser
You will see tha padlock sign with https://domain_name_or_common_name
Now click on the padlock icon and go to “view certificate”. You will the data that you entered when creating the CSR request there.
*Note: Sometimes you may see partially encrypted pages with https:// . The reason is the page may content images or other content with http.
Cheers ! 🙂
Pingback: SSL: 01 Creating a self-signed SSL certificate | Tech Star