本文共 1114 字,大约阅读时间需要 3 分钟。
一、apache:
yum -y install httpd httpd-pear mod_ssl openssl
openssl genrsa -out server.key 2048openssl req -new -key server.key -out server.crt
此步骤需要输入一些证书信息:(如果不想输入,也可一路回车)
Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:shanghaiLocality Name (eg, city) [Default City]:shanghaiOrganization Name (eg, company) [Default Company Ltd]:cccOrganizational Unit Name (eg, section) []:bbbCommon Name (eg, your name or your server's hostname) []:www.test.comEmail Address []:a@a.com
mv {server.key,server.crt} /etc/httpd/conf/
vim /etc/httpd/conf/httpd.conf修改为刚才生成证书文件的路径
openssl genrsa -des3 -out server.key 2048
mv server.key server.key.backopenssl rsa -in server.key.back -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
ssl on;ssl_certificate /etc/nginx/server.crt;ssl_certificate_key /etc/nginx/server.key;
转载地址:http://vgeoa.baihongyu.com/