RHEL5.5 _ configure OpenSSL for Apache to support https services

Source: Internet
Author: User
1: switch to the openssl Certificate Directory: # cd/etc/pki/tls/certs2: create private key: # makeserver. keyumask77; \/usr/bin/opensslgenrsa-des31024 & gt; server. keyGeneratingRSAprivatekey, 1024bitlongmodulus. ++

1: switch to the openssl Certificate directory:
# Cd/etc/pki/tls/certs

2: create a private key:
# Make server. key
Umask 77 ;\
/Usr/bin/openssl genrsa-des3 1024> server. key
Generating RSA private key, 1024 bit long modulus
. ++
... ++
E is 65537 (0x10001)
Enter pass phrase: 123456
Verifying-Enter pass phrase: 123456

3: rewrite the private key and clear the password so that no password is required during httpd startup.
# Openssl rsa-in server. key-out server. key
Enter pass phrase for server. key: 123456
Writing RSA key

4: Certificate issuance Request (CSR)
# Make server. csr
Umask 77 ;\
/Usr/bin/openssl req-utf8-new-key server. key-out server. csr
Enter pass phrase for server. key:
You are about to be asked to enter information that will be ininitialized
Into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]: cn
State or Province Name (full name) [Berkshire]: Fuji
Locality Name (eg, city) [Newbury]: xiamen
Organization Name (eg, company) [My Company Ltd]: xmu
Organizational Unit Name (eg, section) []: eda
Common Name (eg, your name or your server's hostname) []: 192.168.1.105 (note: this should be consistent with ServerName in httpd. conf; otherwise, a certificate error is prompted)
Email Address []: clough@eda.com
Please enter the following 'extra 'attributes
To be sent with your certificate request
A challenge password []: cliff
An optional company name []: xmu

5. Create a CA and sign the CA.
# Openssl x509-in server. csr-req-signkey server. key-days 365-out server. crt
Signature OK
Subject =/C = cn/ST = fujian/L = xiamen/O = lexie/OU = lexie/CN = 192.168.1.105/emailAddress = clough@sohu.com
Getting Private key

6: Adjust/etc/httpd/conf. d/ssl. conf to correctly reference the certificate created above.
# Vi/etc/httpd/conf. d/ssl. conf

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

7. Start the service
# Service httpd restart

8: http and https are not supported yet.

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

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.