呆羊在晒太阳  
公告
  • Y:哦,是你呀。
    X:我现在正在忙。
    Y:忙什么?
    X:呵呵,今天出太阳了,我把钱搬出来晒一晒。
    ***********************
    abc
    小叉
    很高兴能结识大家!
    ***********************
日历
<2006年12月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456
统计
  • 随笔 - 164
  • 文章 - 2
  • 评论 - 196
  • 引用 - 0

导航

常用链接

留言簿(7)

随笔分类(158)

文章分类(2)

相册

log

搜索

  •  

积分与排名

  • 积分 - 67616
  • 排名 - 794

最新评论

阅读排行榜

 

前面已经安装好了apache2和ssl

首先建立自己的CA文件夹
CA/myCA

1.创建CA认证

找到
etc/ssl/openssl.cnf 
COPY一份到myCA下面

修改其下的变量值
dir = /home/mocci/CA/myCA

建立相应的目录:

mkdir -p //home/mocci/CA/myCA/certs
mkdir -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]:Zhejiang
Locality Name (eg, city) []:Hangzhou
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Mux Team
Organizational Unit Name (eg, section) []:muxcn
Common Name (eg, YOUR name) []:www.mux.net
Email Address []:ling2113@gmail.com

将创建的CA的密匙和自认证文件复制

cp ca.privatekey /etc/ssl/CA/private/cakey.pem
cp 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_ssl

a2enmod ssl

复制apache.pem到/etc/apache2/ssl

建立CADOMAIN
进入/etc/apache2/sites-available/
cp default ssl
ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl

修改ssl
NameVirtualHost *:443

<VirtualHost *:443>

Add the following two lines under the <VirtualHost *:443> line:

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem/
修改default和ssl
etc/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.conf
Listen 443

重启apache2
sudo /etc/init.d/apache2 force-reload

输入PASS,OK!!

测试
https://localhost/svn/myprojects

you must enable URL rewrite support in the Ubuntu Apache 2 package by executing the following command:

sudo a2enmod rewrite

You should receive the following output from the above command:

Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.

posted on 2006-12-18 17:21 小叉 阅读(1819) 评论(0)  编辑  收藏 所属分类: ubuntu

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © 小叉 Powered by: 博客园 模板提供:沪江博客