An easy way to configure SSL for Apache under Ubuntu (Implementation of HTTPS)

Source: Internet
Author: User
Tags install openssl openssl x509

1. Enable the SSL module

    1. sudo a2enmod SSL


2. Installing OpenSSL

    1. sudo apt-get install OpenSSL


3. Create a CA signature (do not use the password removal-des3 option)

    1. OpenSSL genrsa-des3-out Server.key 1024


4. Create a CSR (Certificate Signing Request)

    1. OpenSSL Req-new-key server.key-out SERVER.CSR


5. Self-issued certificate

    1. OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt


6. Copy to the appropriate directory

    1. sudo cp server.crt/etc/ssl/certs
    2. sudo cp server.key/etc/ssl/private

7. Modify the configuration file

    1. sudo cp/etc/apache2/sites-enabled/000-default/etc/apache2/sites-enabled/001-ssl
    2. sudo vim 001-ssl

In the <virtualhost *:80> section, add content below the DocumentRoot line:

    1. Sslengine on
    2. Ssloptions +strictrequire
    3. Sslcertificatefile/etc/ssl/certs/server.crt
    4. Sslcertificatekeyfile/etc/ssl/private/server.key

Port modified to: 443, <virtualhost *:443> (SSL port)

8. Restart Apache

      1. Sudo/etc/init.d/apache2 Force-reload
      2. Sudo/etc/init.d/apache2 restart

An easy way to configure SSL for Apache under Ubuntu (Implementation of HTTPS)

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.