qileilove

          blog已經轉移至github,大家請訪問 http://qaseven.github.io/

          Apache搭建HTTPS Virtual Host

           Apache 搭建HTTPS Virtual Host
            1.創(chuàng)建SSL證書
            首先需要安裝openssl,linux系統默認已安裝,如沒有則用以下命令安裝:
            sudo apt-get install openssl
            sudo apt-get install libssl-dev
            創(chuàng)建證書:
            cd /etc/ssl/private
            sudo openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes -keyout demo.key -out demo.crt
            參數說明:
            -x509 顯示證書和簽名工具
            -days 證書的有效期
            -sha1 證書加密算法
            -newkey rsa:1024 創(chuàng)建一個新key,1024表示公鑰長度為1024bits
            命令執(zhí)行完會創(chuàng)建demo.key與demo.crt
            更多參數說明可以參考:http://www.openssl.org/docs/apps/openssl.html
            創(chuàng)建步驟:
          root@ubuntu:/etc/ssl/private# sudo openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes -keyout demo.key -out demo.crt
          Generating a 1024 bit RSA private key
          .......++++++
          ...........++++++
          writing new private key to 'demo.key'
          -----
          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) [AU]:CN
          State or Province Name (full name) [Some-State]:GD
          Locality Name (eg, city) []:GZ
          Organization Name (eg, company) [Internet Widgits Pty Ltd]:fdipzone.Ltd
          Organizational Unit Name (eg, section) []:test
          Common Name (eg, YOUR name) []:demo.fdipzone.com
          Email Address []:fdipzone@gmail.com
          root@ubuntu:/etc/ssl/private#
            需要填寫的項目:
          Country Name (2 letter code) [AU]: 國家
          State or Province Name (full name) [Some-State]:省份
          Locality Name (eg, city) []:城市
          Organization Name (eg, company) [Internet Widgits Pty Ltd]:公司名稱
          Organizational Unit Name (eg, section) []: 組織單位名稱
          Common Name (eg, YOUR name) []: 填寫域名
          Email Address []:電郵地址
            2.創(chuàng)建Virtual Host
          <VirtualHost *:443>
          DocumentRoot /home/fdipzone/demo
          ServerName demo.fdipzone.com
          <Directory "/home/fdipzone/demo">
          allow from all
          AllowOverride all
          Options -Indexes FollowSymLinks
          </Directory>
          SSLEngine on
          SSLCertificateFile /etc/ssl/private/demo.crt
          SSLCertificateKeyFile /etc/ssl/private/demo.key
          SSLCipherSuite AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
          SSLHonorCipherOrder on
          </VirtualHost>
            開啟SSL Engine及設置使用的證書,端口443
            SSLEngine on
            SSLCertificateFile /etc/ssl/private/demo.crt
            SSLCertificateKeyFile /etc/ssl/private/demo.key

          posted on 2014-04-08 10:30 順其自然EVO 閱讀(128) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網站導航:
           
          <2014年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          導航

          統計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 读书| 玉屏| 古田县| 文水县| 永仁县| 泗水县| 江源县| 新津县| 兴隆县| 遂川县| 兰溪市| 章丘市| 甘南县| 上杭县| 云霄县| 华容县| 栖霞市| 晋中市| 喀什市| 裕民县| 个旧市| 都江堰市| 湄潭县| 常山县| 罗平县| 安徽省| 项城市| 木兰县| 平远县| 昌图县| 平安县| 长宁县| 临江市| 来宾市| 油尖旺区| 云安县| 万宁市| 彝良县| 台东市| 肇州县| 平阳县|