Tag Archives: centos

CentOS 5安装ssl

以root身份进入控制台,进入下面命令:

~]# yum -y install mod_ssl

~]# cd /etc/pki/tls/certs/

certs]# make server.key
certs]# openssl rsa -in server.key -out server.key
certs]# make server.csr
certs]# openssl x509 -in server.csr -out server.pem -req -signkey server.key -days 365
certs]# chmod 400 server.*

certs]# vi /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/server.pem ← 追加
SSLCertificateKeyFile /etc/pki/tls/certs/server.key ← 追加

成功!

更多可参照:http://www.centospub.com/make/ssl.html(该页面教程基于CentOS4.4,所以与上面步骤和命令略有不同)。