|
发表于 2006-9-26 13:29:38
|
显示全部楼层
Post by 终极幻想
问问,这个能否解决密码提示这个问题?
RPM安装httpd+openssl+mod_ssl后生成密钥、CSR、CA和证书过程
一、制作密钥(私钥)
1、cd /etc/httpd/conf/ssl.key
2、openssl genrsa [-des3] –out test.local.key [1024]
二、生成CSR
1、cd ../ssl.scr
2、openssl req –new –key ../ssl.key/test.local.key –out ./test.local.csr
三、创建CA
1、cd /etc/httpd/conf/ssl.prm
2. /usr/share/ssl/misc/CA –newca
此时,会在/etc/httpd/conf/ssl.prm/demoCA目录下生成CA公钥(cacert.prm),私钥(private/cakey.prm),以及目录certs,crl,newcerts,private, 文件index.txt和serial 。
四、用CA密钥签发CSR请求,生成CRT证书
1、cd /etc/httpd/conf/ssl.prm
2. openssl ca –in ../ssl.csr/test.local.csr –out ../ssl.crt/test.local.crt –days 365 –config /usr/share/ssl/openssl.cnf
还可以用参数-keyfile来指定CA密钥(cakey.prm)的位置,-cert来指定CA证书(cacert.prm)的位置。可以通过openssl ca –help来看帮助。
或者,自签发CRT证书:1)cd /etc/httpd/conf ; 2) openssl req –x509 –key ./ssl.key/test.local.key –in ./ssl.csr/test.local.csr –out ./ssl.crt/test.local.crt
至此,我们已经为apache生成了SSL密钥、CSR和CRT了。
五、设置ssl.conf文件
编辑/etc/httpd/conf.d/ssl.conf文件,修改
SSLCertificateFile (CRT路径)
SSLCertificateKeyFile (私钥路径)
增加 SSLProtocol all
同时,把<VirtualHost >段修改
六、测试
源代码包安装步骤 RHEL4中的试验(当前目录/usr/local/src)
首先,下载且解压包到/usr/local/src目录下
1、 编译openssl
cd openssl
./configure –prefix=/usr/local/openssl
make
make install
2. 编译mod_ssl
./configure –with-apache=../apache
3. 编译apache
SSL_BASE=../openssl ./configure --enable-module=ssl(或者so) –prefix=/usr/local/apache (apache2.0以上版本用--enable-so,而不是–enable-module)
make (这里容易出错)
make certificate
make install |
|