Enable SSL for centos 5
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.