Apache2 and HTTPS certificate configuration

Source: Internet
Author: User

Environmental Ubuntu12.04

Server Configuration

1, first in the access to find/etc/apache2/apache2.conf configuration file, which contains more configuration file path such as: httpd.conf/ports.conf (port configuration)/site-enabled/, etc.

2, in port.conf Configuration port (http port=80, HTTPS port = 443)

Namevirtualhost *:80

Listen 80

Namevirtualhost *:443

Listen 443

3, locate the certificate with the configuration path of key in/etc/apache2/sites-enabled/default-ssl, configure the following three places

Sslcertificatefile/etc/apache2/ssl/httpd.cert

Sslcertificatekeyfile/etc/apache2/ssl/httpd.key

Sslcertificatechainfile/etc/apache2/ssl/cacert.pem (here Cacert.pem and Httpd.cert content are exactly the same)

When the certificate is generated, the common name = Native IPis configured, otherwise the authentication is not available and the command is as follows:

OpenSSL req-x509-nodes-newkey ras:2048-keyout server.key-out server.crt-days 10950

4, after the configuration is complete, service apache2 restart

Client use

Wget-ca--certificate=/certpath/cert-p/dstfilepath HTTPS://... Ip.. /srcfile (if accessed via HTTP, the client will not validate the certificate)

wget--no-check-certificate-p/dstfilepath http://... Ip.. /srcfile;

When the client uses the certificate, the local time must be later than the server generation time. Otherwise, the certificate not Alive is prompted.

  

Apache2 and HTTPS certificate configuration

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.