首页 > 代码库 > centos apache搭建https

centos apache搭建https

[root@localhost ~]$ cd /opt/src/httpd-2.2.29/modules/ssl/

[root@localhost ssl]$ apxs

[root@localhost ssl]$ /usr/local/apache2/bin/apxs -i -c -a -D HAVE_OPENSSL=1 -I /usr/include/openssl/  -lcrypto -lssl -ldl *.c

[root@localhost ssl]# vim /etc/httpd/extra/httpd-ssl.conf

DocumentRoot "/var/www/api"
ServerName api.example.com:443
SSLEngine on
SSLCertificateFile "/etc/httpd/server.crt"
SSLCertificateKeyFile "/etc/httpd/server.key"

[root@localhost ssl] /usr/local/apache2/bin/httpd -t

[root@localhost ssl] service httpd restart


注:

server.crt、server.key来自startssl

centos apache搭建https