安装openssl

$ sudo apt-get install openssl

产生一个密钥对

这里有必要注意的是,国家名一定要是标准的缩写,中国是CN;通用名一定是FQDN
$ openssl req -new -nodes -keyout private.key -out public.csr
Generating a 2048 bit RSA private key
.................+++
........+++
writing new private key to 'private.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:beijing
Locality Name (eg, city) []:haidian
Organization Name (eg, company) [Internet Widgits Pty Ltd]:zz
Organizational Unit Name (eg, section) []:zzwu
Common Name (e.g. server FQDN or YOUR name) []:FQDN
Email Address []:wuzz77@126.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:kaileihan
An optional company name []:kkle
wuzz@dacbj-zz:/var/www/pritools/docs/apache$ ls -a
.  ..  ap-ssl.htm  index.php  left.php  private.key  public.csr

将生成的文件移动到指定位置

$ sudo mv private.key /etc/ssl/private/
$ sudo mv public.csr /etc/ssl/certs/











如果有任何问题请发邮件到 isteps@126.com


广告内容, 如果不忙, 跪求点击