Tools:apache Deploying HTTPS Services

Source: Internet
Author: User

Transferred from: https://www.cnblogs.com/ccccwork/p/6529367.html

1, to build HTTPS, must have something

1, Hypertext Transfer Protocol httpd (Apache) and SSL module (MOD_SSL)2, the certificate used to encrypt the hyper-file transfer. (OpenSSL makes self-signed certificate)3, test

2, installation httpd

Yum Install httpd mod_ssl-y

3. Installing OpenSSL

Yum Install Openssl-y

/etc/httpd/conf//var/www//etc/pki/tls/certs//etc/pki/tls/private/

4. Use OpenSSL to generate certificate files "Attention! The certificate file is generated here in the current directory "

1-out server.key 10242-new-key server.key-outSERVER.CSR3-req-days 365-in< /c10> Server.csr-signkey server.key-out SERVER.CRT

5, vim/etc/httpd/conf/httpd.conf Modify the configuration file "#如果不配置此段, the use of HTTP access will not automatically jump to HTTPS, but the HTTPS input corresponding to the port can be accessed, That is, the same machine can have both HTTP and https "

# Add the following code to enable automatic use of the HTTPS protocol to open Web sites  %{https}!= ^ (. *) https://%{server_name}$1 [l,r]

6, vim/etc/httpd/conf.d/ssl.conf, modify the SSL configuration file, specify the private key and the certificate's directory.

sslcertificatekeyfile/opt//opt/server.crt              # # #注意! The path here is the path where the certificate is generated in step "4, Generate certificate files with OpenSSL"


7. Start the httpd service, my release version is Rhel 7.3 so the command changed to Systemctl, if it is 6.* version, please use service httpd start

Systemctl start httpd or service httpd start

8, with IE browser authentication, because this is a self-signed certificate, the browser will be reported unsafe, point to continue the traffic is good.
Input on client: https://Server IP address

Tools:apache Deploying HTTPS Services

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.