呆羊在曬太陽  
          公告
          • Y:哦,是你呀。
            X:我現在正在忙。
            Y:忙什么?
            X:呵呵,今天出太陽了,我把錢搬出來曬一曬。
            ***********************
            abc
            小叉
            很高興能結識大家!
            ***********************
          日歷
          <2006年12月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456
          統計
          • 隨筆 - 164
          • 文章 - 2
          • 評論 - 196
          • 引用 - 0

          導航

          常用鏈接

          留言簿(7)

          隨筆分類(158)

          文章分類(2)

          相冊

          log

          搜索

          •  

          積分與排名

          • 積分 - 71091
          • 排名 - 778

          最新評論

          閱讀排行榜

           

          前面已經安裝好了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 小叉 閱讀(1832) 評論(0)  編輯  收藏 所屬分類: ubuntu
           
          Copyright © 小叉 Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 濉溪县| 黄平县| 加查县| 昌都县| 定陶县| 甘洛县| 聂拉木县| 陆良县| 襄城县| 荆州市| 黄山市| 清原| 博客| 蓝山县| 寿阳县| 新乡市| 阜新| 绵竹市| 右玉县| 台湾省| 邹城市| 灵石县| 翁源县| 青河县| 山阴县| 灵丘县| 南康市| 潮州市| 海晏县| 海城市| 额济纳旗| 灌云县| 永康市| 蒙山县| 郧西县| 昌邑市| 宁晋县| 托克逊县| 陆丰市| 郯城县| 进贤县|