[root@localhost ~]$ cd /opt/src/httpd-2.2.29/modules/ssl/
[root@localhostssl]$ apxs
[root@localhostssl]$/usr/local/apache2/bin/apxs -i -c -a -D HAVE_OPENSSL=1 -I /usr/include/openssl/ -lcrypto -lssl -ldl *.c
[root@localhostssl]# vim /etc/httpd/extra/httpd-ssl.conf
DocumentRoot"/var/www/api" ServerNameapi.example.com:443 SSLEngineon SSLCertificateFile"/etc/httpd/server.crt" SSLCertificateKeyFile"/etc/httpd/server.key"
[root@localhostssl] /usr/local/apache2/bin/httpd -t
[root@localhostssl]service httpd restart
注:
server.crt、server.key来自startssl
原文链接:https://www.f2er.com/centos/379591.html