Because the company to develop small programs, due to the small program is more special, the need for HTTPS services, so the next Apache HTTPS services, the approximate process is as follows: 1. Request an HTTPS certificate from a certificate authority and get the certificate and private key 2. Installing Apache Mod_ ssl.so module Yum-y install MOD_SSL3. If a firewall is enabled to add HTTPS services (service iptables status or firewall status with Systemctl FIREWALLD)--dport 443-j tcp with iptables iptables-a forward-p TCP iptables-a forward-p ACCEPT (for releasing client requests for HTTPS service) Sport 443-j ACCEPT (for releasing messages sent by HTTPS server to client)in the case of firewallFirewall-cmd--permanent--add-service=httpsfirewall-cmd--reload 4. Modify Ssl.confvim/etc/httpd/conf.d/ssl.confdocumentroot "/var/www/html/test"ServerName wxapp.peopleyuqing.com:443SSLCERTIFICATEFILE/ETC/PKI/TLS/CERTS/TEST.CRTSslcertificatekeyfile/etc/pki/tls/private/test.key
Generate the appropriate files based on the certificates and private keys provided by the third party generate TEST.CRT files in the/etc/pki/tls/certs directory sudo vim test.crt-----BEGIN CERTIFICATE-----Miifbdccbfsgawibagimvtlzsewroditrffxma0gcsqgsib3dqebcwuamgyxczajbgnvbaytakjfmrkwfwydvqqkexbhbg9iywxtawdui G52lxnhmtwwogydvqqdeznh ..... ..... .... ..... ......................... ..... ..... ..... ..... ..... .............. .......... ...... CERTIFICATE.-----END of the----- in the/etc/pki/tls/-in-the-the-.....?????????. Generate Test.key file under PRIVATE directory sudo vim test.key-----BEGIN Private KEY-----MIIEVWIBADANBGKQHKIG9W0BAQEFAASCBKKWGGSLAGEAAOIBAQDFXXLJGBV8BSND7MAP1OD8GPKHCF52QBYSABHB9GGQFRJPHKWC7SR /bwsikw8iii7usf/oefxwyxq0 ......................................................................................................................... ....-----END PRIVATE KEY----- 5. Modify the httpd.conf load mod_ssl.so module LoadModule ssl_module, and so on, ....., .... Change the loading of a. modules/mod_ssl.so loading the ssl.conf file include conf.d/*.conf (or include conf.d/ssl.conf) 6. Test configuration file and restart Apachesudo httpd-t (or sudo service httpd configtest) sudo service httpd restart 7. Generate a PHP test file at the root you just specified to verify that the HTTPS domain name is configured successfully
CentOS configuration Apache HTTPS service