CentOS Configuration Apache HTTPS service

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.