1. Create an SSL certificate
First you need to install the Openssl,linux system by default installed, if not installed with the following command:
sudo apt-get install OpenSSL
sudo apt-get install Libssl-dev
To create a certificate:
Cd/etc/ssl/private
sudo openssl req-new-x509-days 365-sha1-newkey rsa:1024-nodes-keyout demo.key-out demo.crt
Parameter description:
-x509 Display certificate and signing tool
Validity period of-days certificate
-SHA1 Certificate Encryption algorithm
-newkey rsa:1024 creates a new key,1024 indicating a public key length of 1024bits
Demo.key and DEMO.CRT are created after the command is executed
More parameter description can refer to: http://www.openssl.org/docs/apps/openssl.html
To create a step:
root@ubuntu:/etc/ssl/private# sudo openssl req-new-x509-days 365-sha1-newkey rsa:1024-nodes-keyout Demo.key- Out DEMO.CRT generating a 1024 bit RSA private key ... ++++++ ... ++++++ writing new private key to ' dem '., ...
O.key '-----You are about to is asked to enter information that'll be incorporated into your certificate request.
What you are about to enter the What is called a distinguished Name or a DN. There are quite a few fields but can leave some blank for some fields There would be a default value, If you enter
'. ', the field would be left blank. -----Country Name (2 letter code) [AU]:CN State or province name (full name) [SOME-STATE]:GD locality name (eg, CIT y) []:gz organization Name (eg, company) [Internet widgits Pty Ltd]:fdipzone. Ltd. organizational unit name (eg, section) []:test Common name (eg, YOUR Name) []:d emo.fdipzone.com Email A ddress []:fdipzone@gmail.com root@ubuntu:/etc/ssl/private#
Items to be filled in:
Country Name (2 letter code) [AU]: Country
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/tools/
State or province Name (full name) [Some-state]: Province
Locality Name (eg, city) []: Cities
Organization name (eg, company) [Internet Widgits Pty Ltd]: Corporate name
Organizational unit name (eg, section) []: Organizer Name
Common name (eg, YOUR name) []: Fill in the domain name
email address []: email Addresses
2. Create Virtual Host
<virtualhost *:443>
documentroot/home/fdipzone/demo
ServerName demo.fdipzone.com
<directory "/home/fdipzone/demo" >
allow from all
allowoverride all
options-indexes followsymlinks
</ Directory>
sslengine on
sslcertificatefile/etc/ssl/private/demo.crt
sslcertificatekeyfile/etc/ Ssl/private/demo.key
Sslciphersuite aes128-sha:high:medium:!anull:! MD5
Sslhonorcipherorder on
</VirtualHost>
Open SSL engine and set the certificate used, port 443
Sslengine on
Sslcertificatefile/etc/ssl/private/demo.crt
Sslcertificatekeyfile/etc/ssl/private/demo.key