To enable ssl following these steps:
- Run the llowing commands:
root@root#a2enmod ssl
root@root#a2ensite default-ssl.cnf
- Make a directory in /etc/apache2/ and cd to it:
root@root#mkir /etc/apache2/ssl
root@root#cd /etc/apache2/ssl
Create self-sighned sertificate
- Make a certificate then create key and pem file
root@root#make-ssl-cert /usr/share/ssl-cert/ssleay.cnf apache.crt
root@root#cp apache.crt apache.pem
root@root#cp apache.crt apache.key
- Open the htaccess:
root@root#nano/etc/apache2/site-enable/default-ssl.conf
then add the change these line to:
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKey /etc/apache2/ssl/apache.key
save and exit. 5. Restart the apache service:
root@root#/etc/init.d/apache2 restart
- Disable the http:
root@root#nano /etc/apache2/ports.conf
comment this line:
listen 80