To enable SSL in CentOS5, install mod_sslyuminstallmod_ssl in/etc/httpd/conf. d/there will be an ssl. to open the conf file, check the certificate and key location SSLCertificateFile/etc/pki/tls/certs/localhost. crtSSLCertificateKey CentOS 5 enable SSL
Install mod_ssl first
Yum install mod_ssl
After completion
There is an ssl. conf file under/etc/httpd/conf. d/. open
It mainly looks at the certificate and key location
SSLCertificateFile/etc/pki/tls/certs/localhost. crt
SSLCertificateKeyFile/etc/pki/tls/private/localhost. key
Generate a key and enter/etc/pki/tls/private,
Delete the original
Rm-f localhost. key
Generate a new
Openssl genrsa 1024> localhost. key
Return to the certs Directory
Cd ../certs
Delete original certificate
Rm-rf localhost. crt
Generate a new
You can use commands
Make testcert is automatically generated. you can also enter your own command and then centos will prompt you to enter some information, such as country/region email, and write it at will.
Openssl req-new-x509-days 365-key ../private/localhost. key-out localhost. crt
Enter the required information and the certificate is generated.
The reason for using a name such as localhost. crt is that it is specified in ssl. conf. the two places must be the same.
Open ssl. conf in/etc/httpd/conf. d and find
, Change
DocumentRoot "/var/www/html/www"
ServerName www.linuxidc.com
Change the information of the ssl domain you need, restart apache, and end the configuration.
Now we can access the website through https and receive a warning under ie6, because this is our own certificate.
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