Configure HTTPS access to websites on Mac Apache

Source: Internet
Author: User

  1. Introducing httpd-ssl.conf Files

    Locate the httd-conf file in the appropriate directory is generally under the /etc/apache2/httpd.conf

    Cancel the comment symbol in front of the include/private/etc/apache2/extra/httpd-ssl.conf # which introduces the httpd-ssl.conf file

  2. generate keys and certificates.

    Since the name of the key and certificate is already configured in/private/etc/apache2/extra/httpd-ssl.conf, please do not modify the name of the generated key file in the following steps. If modified, please change the file path and name in the httpd-ssl.conf

    Cd/etc/apache2

    (1) sudo openssl genrsa-des3-out server.key 1024

    Enter a passphrase for your private key.    (Input key password will be used in the next process, random input 123456) ;

    (2) OpenSSL Req-new-key server.key-out SERVER.CSR

    The next province city email and so on options can be left blank and press ENTER to enter the next step

    (3) sudo OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt

    (4) Backup

    CP Server.key Server.key.copy

    OpenSSL rsa-in server.key.copy-out Server.key

  3. Restart Apache

    sudo apachectl restart

    Ask Https:localhost to go to the corresponding page

Configuration site (1) Add Namevirtualhost *:443 (2) at the bottom of the httpd-ssl.conf file and add a configuration similar to the following to <virtualhost *:443> DocumentRoot "path_to _your_projects "ServerName localhost.xxx errorlog"/private/var/log/apache2/xxx-error_log "Transferlog"/private/var /log/apache2/xxx-access_log "Sslengine onsslcertificatefile"/PRIVATE/ETC/APACHE2/SERVER.CRT " Sslcertificatekeyfile "/private/etc/apache2/server.key" </VirtualHost> Note: General to Sslcertificatefile and Sslcertificatekeyfile address with the default is good but in the configuration process if there is a problem can be aware of their address is not a problem

Done!!

The Linux system should do the same. Windows needs to be researched






Configure HTTPS access to websites on Mac Apache

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.