To setup SSL on Apache2 on Ubuntu, please have the following files
- Certificate and CA certificate files
- Private key file
After that, put that two file in the cert folder. Recommend to put at /etc/ssl/certs/
So, copy those file like this :
cp yourdomain.com.crt yourdomain.com.bundle.crt /etc/ssl/certs
After that, you have to locate the key file.
Put the key file on the server as /etc/ssl/private/
Once you know the location, you modify your apache default-ssl file which is /etc/apache2/sites-available/
<VirtualHost *:443>
ServerName www.yourdomain.com
DocumentRoot /var/www/YourDomainRoot
CustomLog /var/log/apache/www.
ErrorLog /var/log/apache/www.
# Example SSL configuration
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLCertificateFile “/etc/ssl/certs/yourdomain.
SSLCertificateKeyFile “/etc/ssl/private/domain.com.
</VirtualHost>
Note:
SSLCertificateFile tell where your crt file is located
SSLCertificateKeyFIle tell where your key file is located
You may need to use SSLCertificateChainFile or SSLCACertificateFile directive for the bundle file.
Now, you have to activate the site that you just created by :
sudo a2enmod ssl
a2ensite default-ssl
and then reload apache2
service apache2 restart
SSL setup on Ubuntu Apache2