Reposted from: network security blog
Original: http://www.safe121.com/post-40.html
Enable ssl first:a2enmod ssl
Then create a certificate
Create a folder for storing certificates:mkdir /home/cert
Then drop the certificate to the Created directory:
openssl req -x509 -newkey rsa:1024 -keyout /home/cert/x73.pem -out /home/cert/x73.pem -nodes -days 9999999999999
Then edit the default configuration file of apache:vim /etc/apache2/sites-available/default(I am used to using nano. vi is so powerful)
Open Nima's editor and write in the last line
<VirtualHost *: 443>
ServerSignature On
SSLEngine On
SSLCertificateFile SSL path (/home/cert/x73.pem)
ServerAdmin x@x73.cc
DocumentRoot "/website path"
Php_admin_value open_basedir "/website path:/tmp"
ServerName Domain Name
ServerAlias Domain Name
CustomLog/website path/log-ssl combined
</VirtualHost>
Enter/etc/init. d/apache2 restart
Restart the apache service. Alternatively, you can: service apache2 restart.
You can use https to access