环境介绍:
RedHat 6.3 X64 english
Apache 2.4
下面是操作步骤:
第一步:#yum -y install mod_ssl
安装完成后,会在/etc/httpd/conf.d/下生成一个ssl.conf文件。通过该文件可以看到证书文件路径为SSLCertificateFile /etc/pki/tls/certs/localhost.crt。 localhost.crt文件为证书文件。默认情况下就有这个文件,我们需要手动创建一个新的同名文件。所以,我要先删除该文件。
$rm �Crf /etc/pki/tls/certs/localhost.crt
第二部:创建新的localhost,crt文件
利用/etc/pki/tls/certs/目录中的make命令创建证书文件。
[root@RH03 certs]# cd cd /etc/pki/tls/certs/
[root@RH03 certs]# make testcert
umask 77 ; \
/usr/bin/openssl req -utf8 -new -key /etc/pki/tls/private/localhost.key -x509 -days 365 -out /etc/pki/tls/certs/localhost.crt -set_serial 0
You are about to be asked to enter information that will be incorporated
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) [XX]:cn
State or Province Name (full name) []:js
Locality Name (eg, city) [Default City]:sz
Organization Name (eg, company) [Default Company Ltd]:justv
Organizational Unit Name (eg, section) []:justv
Common Name (eg, your name or your server's hostname) []:test.example.com
Email Address []:
[root@RH03 certs]# service httpd restart
第三部:使用https访问网站
你可以使用DNS名称访问,也可以使用IP地址直接访问。查看证书:
备注:个人感觉配置SSL还是比较简单的。但是不知道如何在redhat上搭建一个证书服务器。类似于windows的那样。