Apache 使用 acme.sh 配置 SSL¶
1. Server Information for This Article¶
- My friend's brand new CentOS 7 Server with
httpdinstalled
- He updated all pre-installed packages via
yum update
2. Install SSL Module for https¶
The apache official website said that my SSL configuration will need to contain, at minimum, the following directives.
But LoadModule ssl_module modules/mod_ssl.so is already included in /etc/httpd/conf.modules.d/00-ssl.conf, so I did nothing.
3. Install Certs¶
The next step was to use acme.sh to issue a free cert.
Install acme.sh by running just one command
I prefer using the standalone mode. The standalone mode is more reliable than other modes. But you need to stop Apache to release port 80.
Then I began to issue and install my cert in /etc/pki/httpd/private
If you are now issuing your cert, remember to change mydomain.network to your domain name.
4. Install the Cert on Apache Server¶
Edit /etc/httpd/conf.d/ssl.conf, find the two lines with SSLCertificateFile and SSLCertificateKeyFile. Change the path to certs to where we installed just now.
And then restart httpd
Visit my server in Chrome, SSL worked!