Skip to content

Apache中上传SSL证书以启用HTTPS访问

Apache

2025-03-05

Enable HTTPS by uploading SSL certificate

sudo cp mathcs.cn.crt /etc/pki/tls/certs/
sudo cp mathcs.cn.key /etc/pki/tls/private/
sudo cp mathcs.cn.csr /etc/pki/tls/private/

Alter the apache ssl config file:

sudo vi /etc/httpd/conf.d/ssl.conf

Change the line

SSLCertificateFile /etc/pki/tls/certs/mathcs.cn.crt
SSLCertificateKeyFile /etc/pki/tls/private/mathcs.cn.key

where the filename is changed into the newly copied file.