apache ssl
1:生产证书
在/usr/local/apache2/conf下建立一个ssl.key目录,在该目录里输入以下命令
#openssl genrsa -out server.key 1024 Generating RSA private key, 1024 bit long modulus .........++++++ ....++++++ e is 65537 (0x10001)
2:生成服务器证书请求:填些相关证书信息:
#openssl req -new -key server.key -out server.csr Country Name:两个字母的国家代号 State or Province Name:省份名称 Locality Name:城市名称 Organization Name:公司名称 Organizational Unit Name:部门名称 Common Name:你的姓名(最好填写要https的域名或者IP) Email Address:地址其它一路回车
3:签证:
# openssl x509 -days 365 -req -in server.csr -signkey server.key -out server.crt
4:修改权限
# chmod 400 server.*
5:修改配置
# vi /usr/local/apache2/conf/extra/httpd-ssl.conf找到下面两句修改
SSLCertificateFile "/usr/local/apache2/conf/ssl.key/server.crt" SSLCertificateKeyFile "/usr/local/apache2/conf/ssl.key/server.key"
6:修改apache
把httpd.conf的Include conf/extra/httpd-ssl.conf,去掉前面的#,重启apache!