CentOS 6和CentOS 7上搭建web服务器的SSL证书配置
在CentOS 6和CentOS 7上搭建web服务器的SSL证书配置步骤以下:
sudo yum install httpdsudo yum install httpdsudo yum install nginxsudo yum install opensslopenssl genrsa -out private.key 2048
openssl req -new -key private.key -out csr.pemcertificate.crt。/etc/httpd/conf.d/ssl.conf,在以下行中添加证书和私钥文件的路径:SSLCertificateFile /path/to/certificate.crt
SSLCertificateKeyFile /path/to/private.key/etc/httpd/conf.d/ssl.conf,在以下行中添加证书和私钥文件的路径:SSLCertificateFile /path/to/certificate.crt
SSLCertificateKeyFile /path/to/private.key/etc/nginx/nginx.conf,在以下行中添加证书和私钥文件的路径:ssl_certificate /path/to/certificate.crt;
ssl_certificate_key /path/to/private.key;sudo service httpd restartsudo service nginx restart现在,你的web服务器已配置了SSL证书。确保将证书和私钥文件放在安全的位置,并为其设置正确的权限。
TOP