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.