Simple configuration of HTTPS authentication access

Source: Internet
Author: User
Tags openssl rsa

1. Install the ssl module

# Yum-y install mod_ssl

2. Tell apache which website is to Use https, that is, to build a website. It can also be the same as what was previously set up in http.

# Vi/etc/httpd/conf. d/ssl. conf

DocumentRoot/var/www/test/html

Servername www.bkjia.com

3. Create a certificate file

# Cd/etc/pki/tls/certs

[Root@www.bkjia.com] # make server. key ### generate a key file

[Root@www.bkjia.com] # openssl rsa-in server. key-out server. key # Remove the previous password and re-export a password-free

[Root@www.bkjia.com] # make server. crt # generate a self-signed certificate

4. Replace the generated server. key server. crt with the default two.

# Vi/etc/httpd/conf. d/ssl. conf

# SSLCertificateFile/etc/pki/tls/certs/localhost. crt

SSLCertificateFile/etc/pki/tls/certs/server. crt

# SSLCertificateKeyFile/etc/pki/tls/private/localhost. key

SSLCertificateKeyFile/etc/pki/tls/certs/server. key

# Search/crt Replace the last few characters of the line local. crt with server. crt

# Replace the original private key with/etc/pki/tls/certs/server. key in the following private key section. Note that it is under the certs directory.

Related Article

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.