qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請?jiān)L問 http://qaseven.github.io/

          Apache搭建HTTPS Virtual Host

           Apache 搭建HTTPS Virtual Host
            1.創(chuàng)建SSL證書
            首先需要安裝openssl,linux系統(tǒng)默認(rèn)已安裝,如沒有則用以下命令安裝:
            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
            參數(shù)說明:
            -x509 顯示證書和簽名工具
            -days 證書的有效期
            -sha1 證書加密算法
            -newkey rsa:1024 創(chuàng)建一個(gè)新key,1024表示公鑰長度為1024bits
            命令執(zhí)行完會(huì)創(chuàng)建demo.key與demo.crt
            更多參數(shù)說明可以參考: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#
            需要填寫的項(xiàng)目:
          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及設(shè)置使用的證書,端口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ā)表評論。


          網(wǎng)站導(dǎo)航:
           
          <2014年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 来安县| 洪湖市| 田林县| 江华| 礼泉县| 云龙县| 安溪县| 丰原市| 芜湖市| 金阳县| 乌什县| 金门县| 邯郸县| 龙山县| 乐清市| 兰西县| 咸阳市| 浦江县| 都江堰市| 仁布县| 五寨县| 长丰县| 饶阳县| 南投县| 宜宾市| 刚察县| 莱芜市| 新化县| 厦门市| 鄂伦春自治旗| 五家渠市| 达孜县| 德保县| 勃利县| 平谷区| 陆良县| 苏州市| 嘉峪关市| 余干县| 乡城县| 禄劝|