亚洲精品日韩欧美_欧美二区乱c少妇_中文字幕日韩在线播放_日韩不卡中文字幕

English |
  • 美國VPS主機推薦
  • |
  • 代購服務
  • |
  • 10美元以下VPS
  • |
  • VPS新手指南/教程
  • |
  • 留言板
  • |
  • 關于
  • | 登錄 |

    免費SSL證書Let's Encrypt(certbot)安裝使用教程

    2016年07月4日 上午 | 作者:VPS偵探

    letsencrypt

    Let's Encrypt是很火的一個免費SSL證書發行項目,自動化發行證書,證書有90天的有效期。適合個人使用或者臨時使用,不用再忍受自簽發證書不受瀏覽器信賴的提示。去年VPS偵探曾經說過Let's Encrypt的使用教程,但是Let's Encrypt已經發布了新的工具certbot,雖然是新的工具,但是生成證書的使用方法和參數是基本一致的,證書續期更簡單了。但是目前看certbot在一些老版本的Linux發行版上的兼容性還是有問題的,特別是在CentOS 5上因為python版本過低是無法用的,CentOS 6上需要先安裝epel才行,當然也有很多第三方的工具你也可以自己去嘗試一下。

    如果使用lnmp1.4,1.5的話都自帶了生成SSL的工具,直接執行 lnmp ssl add 添加或者 lnmp vhost add 添加域名時"add ssl certificate"啟用并選擇letsencrypt。

    安裝方法:

    如果是CentOS 6、7,先執行:yum install epel-release

    cd /root/
    wget https://dl.eff.org/certbot-auto --no-check-certificate
    chmod +x ./certbot-auto
    ./certbot-auto -n

    ./certbot-auto -n只是用來安裝依賴包的,也可以跳過直接到下面的生成證書的步驟,國內VPS或服務器上使用的話建議先修改為國內的pip源

    單域名生成證書:

    ./certbot-auto certonly --email youemail@vpser.net --agree-tos --no-eff-email --webroot -w /home/wwwroot/www.0794baidu.com -d www.0794baidu.com

    多域名單目錄生成單證書:(即一個網站多個域名使用同一個證書)

    ./certbot-auto certonly --email youemail@vpser.net --agree-tos --no-eff-email --webroot -w /home/wwwroot/www.0794baidu.com -d www.0794baidu.com -d bbs.vpser.net

    多域名多目錄生成一個證書:(即一次生成多個域名的一個證書)

    ./certbot-auto certonly --email youemail@vpser.net --agree-tos --no-eff-email --webroot -w /home/wwwroot/www.0794baidu.com -d www.0794baidu.com -d bbs.vpser.net -w /home/wwwroot/lnmp.org -d www.lnmp.org -d lnmp.org

    提示

    IMPORTANT NOTES:
    - Congratulations! Your certificate and chain have been saved at
    /etc/letsencrypt/live/www.0794baidu.com/fullchain.pem. Your cert will
    expire on 2016-10-01. To obtain a new or tweaked version of this
    certificate in the future, simply run certbot-auto again. To
    non-interactively renew *all* of your certificates, run
    "certbot-auto renew"
    - If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
    Donating to EFF: https://eff.org/donate-le

    就是生成成功。

    生成的證書會存在:/etc/letsencrypt/live/www.0794baidu.com/ 目錄下

    具體Nginx和Apache的配置可以參考:http://www.0794baidu.com/build/letsencrypt-free-ssl.html 里的配置文件。

    修改完配置文件切記重啟或reload nginx。

    證書續期

    cerrbot的續期比原來的更加簡單,因為證書只有90天,所以建議使用crontab進行自動續期:

    crontab 里加上如下規則:0 3 */5 * * /root/certbot-auto renew --disable-hook-validation --renew-hook?"/etc/init.d/nginx reload"?這樣每5天就會執行一次所有域名的續期操作。當然時間也可以自行進行調整,建議別太頻繁,因為他們都有請求次數的限制,如果需要強制更新可以在前面命令上加上 --force-renew 參數。

    注意事項:

    1、因為默認LNMP的虛擬主機里是禁止 . 開頭的隱藏文件及目錄的,所以訪問http://abc.com/.well-known/acme-challenge/**** 這個鏈接的話返回403錯誤,所以必須要將對應虛擬主機配置文件里的
    location ~ /\.
    {
    deny all;
    }
    這段配置刪掉或注釋掉或在這段配置前面加上
    location ~ /.well-known {
    allow all;
    }

    以上配置代碼,然后重啟nginx。

    2、如果要啟用http2的話,建議編輯lnmp.conf,將里面的Nginx_Modules_Options的單引號里加上 --with-openssl=/root/openssl-1.0.2h

    并執行: cd /root && wget -c?https://www.openssl.org/source/openssl-1.0.2h.tar.gz && tar zxf?openssl-1.0.2h.tar.gz ,然后使用升級腳本 ./upgrade.sh nginx 升級nginx至1.9.5或更高版本。

    3、國內有些用戶反映會卡在Installing Python packages...這個地方不動,因為pip的默認源是國外的,國內可能會有點慢,可以執行下面命令來修改pip源為國內的:
    mkdir ~/.pip
    cat > ~/.pip/pip.conf <<EOF
    [global] index-url = https://pypi.doubanio.com/simple/

    [install] trusted-host=pypi.doubanio.com
    EOF

    執行完,再重新運行certbot的命令應該正常安裝python的包了。

    有問題可以在本帖或VPS偵探論壇提問。

    VPS偵探論壇邀請碼:https://bbs.vpser.net/reg.php?invitecode=41f1ca437cCC9FXe?有效期至:2016-7-8 13:07

    >>轉載請注明出處:VPS偵探 本文鏈接地址:http://www.0794baidu.com/build/letsencrypt-certbot.html
    VPS偵探推薦:
    遨游主機VultrLinode搬瓦工LOCVPSKVMLAHOSTKVMHostXen80VPS美國VPS主機,國內推薦騰訊云阿里云

    發表評論

    *必填

    *必填 (不會被公開)

    評論(33條評論)

    1. VPS偵探說道:

      @沒有live文件夾, IP解析的對嗎?填寫的網站目錄正確嗎,看它去請求驗證返回的文件是不對的

    2. 沒有live文件夾說道:

      請問下在執行命令:
      單域名生成證書:

      ./certbot-auto certonly xxxxxx

      之后在/etc/letsencrypt/ 目錄下并沒有生成live等文件夾,目錄下就只有 accounts renewal 兩個目錄

      提示信息為:

      IMPORTANT NOTES:
      - The following errors were reported by the server:

      Domain: http://www.admol.net
      Type: unauthorized
      Detail: Invalid response from
      http://www.xxxxxxxxx.xxx/.well-known/acme-challenge/xxxxx
      "

      <meta http-equiv="X-UA-Compatible" content="IE=edge""

      To fix these errors, please make sure that your domain name was
      entered correctly and the DNS A record(s) for that domain
      contain(s) the right IP address.

      請問下這是為什么呢

    3. VPS偵探說道:

      @偏執者, 沒遇到過這個估計可能是被系統kill了,centos上的話安裝的依賴包基本上是python python-libs python-devel python-tools python-pip python-virtualenv dialog libffi-devel augeas-libs這些,yum命令裝一下就行,還是可在安裝包下載安裝那邊的話估計就是你設置的系統源慢了,再就是還會pip安裝一下軟件包,國內的話也可以嘗試改成一些國內的pip源

    4. 偏執者說道:

      補充一下錯誤代碼
      Creating virtual environment...
      Installing Python packages...
      /root/certbot-auto: line 1147: 14764 Killed "$0" --le-auto-phase2 "$@"

      Connection closed.

    5. 偏執者說道:

      軍哥,使用您的教程成功安裝部署SSL證書。
      但是在使用您的續期指令 /root/certbot-auto renew 之后,停留在這一步 Installing Python packages... 幾個小時都沒有任何反應,重復嘗試多次均為同樣情況,停留到這一步沒有任何反應。請問這個問題如何解決?

    6. VPS偵探說道:

      @xiangyudashu, python2.6下支持有問題,這上面沒有具體最后的錯誤信息不好說

    7. xiangyudashu說道:

      軍哥 執行完 ./certbot-auto -n
      之后,提示
      WARNING: unable to check for updates.
      Creating virtual environment...
      Installing Python packages...
      Traceback (most recent call last):
      File "/tmp/tmp.7G60uNOf6f/pipstrap.py", line 146, in
      exit(main())
      File "/tmp/tmp.7G60uNOf6f/pipstrap.py", line 130, in main
      for url, digest in PACKAGES]
      File "/tmp/tmp.7G60uNOf6f/pipstrap.py", line 112, in hashed_download
      response = opener().open(url)
      File "/usr/lib/python2.6/urllib2.py", line 391, in open
      response = self._open(req, data)
      File "/usr/lib/python2.6/urllib2.py", line 409, in _open
      '_open', req)
      File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
      result = func(*args)
      File "/usr/lib/python2.6/urllib2.py", line 1198, in https_open
      return self.do_open(httplib.HTTPSConnection, req)
      File "/usr/lib/python2.6/urllib2.py", line 1165, in do_open
      raise URLError(err)
      urllib2.URLError:

      這個是怎么個情況?求軍哥百忙之中抽空給個解答啊

    8. VPS偵探說道:

      @LisonFan, 這個只是讓他來安裝依賴包,有這個提示肯定依賴包已經安裝好了

    9. LisonFan說道:

      執行完 ./certbot-auto -n
      最后提示如下:
      Missing command line flags. For non-interactive execution, you will need to specify a plugin on the command line. Run with '--help plugins' to see a list of options, and see https://eff.org/letsencrypt-plugins for more detail on what the plugins do and how to use them.

      是什么意思呢?

    10. VPS偵探說道:

      @hjoker, fullchain.pem 中就包含中間證書

    11. hjoker說道:

      按照教程安裝了,現在chrome提示不受信任的證書。。。網上查了說是缺少中間證書,求破

    12. VPS偵探說道:

      @Chilsion, 沒按要求裝epel吧

    13. Chilsion說道:

      CentOS 6.8 nginx環境。執行
      cd /root/
      wget https://dl.eff.org/certbot-auto --no-check-certificate
      chmod +x ./certbot-auto
      ./certbot-auto -n
      后,出現以下錯誤,請問怎么解決?
      Complete!
      Creating virtual environment...
      Traceback (most recent call last):
      File "/usr/bin/virtualenv", line 2, in
      import virtualenv
      ImportError: No module named virtualenv

    14. VPS偵探說道:

      @邀請碼, 文章末尾自己找

    15. 邀請碼說道:

      http://bbs.vpser.net/邀請碼 是多少啊

    16. 555說道:

      驗證碼

    主站蜘蛛池模板: 欧美最猛黑人xxxx黑人猛叫黄| 国产精品久久久久久久久久久久午夜片| 亚洲日本一区二区三区在线不卡| 国产精品免费成人| 久久艹在线视频| 欧美 日韩 国产在线观看| 欧美一区三区二区在线观看| 久久在线免费观看视频| 久久精品99无色码中文字幕| 国产999在线观看| 国产精品青草久久久久福利99| 91|九色|视频| 国产精品一香蕉国产线看观看| 久久精品免费一区二区| 日本高清不卡一区二区三| 亚洲伊人久久综合| 99精品国产高清一区二区| 高清视频一区二区三区| 国产精品久久久久久久av大片 | 无码人妻aⅴ一区二区三区日本| 国产精品高清网站| 国产精品情侣自拍| 国产成人综合久久| y111111国产精品久久婷婷| 丁香六月激情网| 99精品一级欧美片免费播放| 国产mv久久久| 亚洲精品国产精品国自产观看| 91精品国产网站| 日本免费高清一区二区| 欧美日韩一区在线视频| 欧美成人精品在线| 韩国国内大量揄拍精品视频| 国产欧美日韩一区| 不卡伊人av在线播放| 亚洲精品自在在线观看| 日韩免费中文专区| 欧美精品一区在线| 精品国产一区二区三区久久久狼| 国产欧美在线播放| 国产精品美女久久久久久免费|