Blog信息 |
blog名称: 日志总数:1304 评论数量:2242 留言数量:5 访问次数:7584151 建立时间:2006年5月29日 |

| |
[Subversion]apache + subervison 配置SSL 软件技术
lhwork 发表于 2006/12/18 17:39:38 |
前面已经安装好了apache2和ssl首先建立自己的CA文件夹CA/myCA1.创建CA认证找到etc/ssl/openssl.cnf COPY一份到myCA下面修改其下的变量值dir = /home/mocci/CA/myCA建立相应的目录:mkdir -p //home/mocci/CA/myCA/certsmkdir -p /home/mocci/CA/myCA/newcerts建立文件:echo “01″ > /etc/ssl/CA/serial && touch index.txt建立root CA的密匙,需要你建立一个CA的密码:openssl genrsa -des3 2048 > ca.privatekey
openssl req -new -x509 -key ca.privatekey -days 3650 -out ca.cert
Country Name (2 letter code) [AU]:CN State or Province Name (full name) [Some-State]:ZhejiangLocality Name (eg, city) []:HangzhouOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Mux Team Organizational Unit Name (eg, section) []:muxcnCommon Name (eg, YOUR name) []:www.mux.net Email Address []:ling2113@gmail.com
将创建的CA的密匙和自认证文件复制cp ca.privatekey /etc/ssl/CA/private/cakey.pemcp ca.cer /etc/ssl/CA/cacert.pem
CA搞定。
2. 建立apache的ssl认证
首先建立用户的密匙,需要你设置一个密码openssl genrsa -des3 2048 > cassl.privatekey
然后生成CA认证的申请文件openssl req -days 3650 -key cassl.privatekey -new -out cassl.csr
生成CA的认证文件openssl ca -out cassl.pem -days 3650 -infiles cassl.csr如果找不到的话,可以用export OPENSSL_CONF=……来设定你的CA路劲
cat cassl.privatekey cassl.pem > apache.pem
3. 配置apache2服务器
启动apache2下的mod_ssla2enmod ssl
复制apache.pem到/etc/apache2/ssl建立CADOMAIN进入/etc/apache2/sites-available/cp default sslln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl修改sslNameVirtualHost *:443
<VirtualHost *:443>
Add the following two lines under the <VirtualHost *:443> line:
SSLEngine OnSSLCertificateFile /etc/apache2/ssl/apache.pem/修改default和ssletc/apache2/sites-enabled/default /etc/apache2/sites-enabled/ssl, and modify the NameVirtualHost * directive to resemble: NameVirtualHost *:80 and the VirtualHost * directive to resemble: <VirtualHost *:80>添加https的监听端口443,vi /etc/ports.confListen 443
重启apache2sudo /etc/init.d/apache2 force-reload输入PASS,OK!!测试https://localhost/svn/myprojects |
|
|