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

English |
  • 美國VPS主機(jī)推薦
  • |
  • 代購服務(wù)
  • |
  • 10美元以下VPS
  • |
  • VPS新手指南/教程
  • |
  • 留言板
  • |
  • 關(guān)于
  • | 登錄 |

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

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

    letsencrypt

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

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

    安裝方法:

    如果是CentOS 6、7,先執(zhí)行: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只是用來安裝依賴包的,也可以跳過直接到下面的生成證書的步驟,國內(nèi)VPS或服務(wù)器上使用的話建議先修改為國內(nèi)的pip源

    單域名生成證書:

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

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

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

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

    ./certbot-auto certonly --email youemail@vpser.net --agree-tos --no-eff-email --webroot -w /home/wwwroot/m.0794baidu.com -d m.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/m.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

    就是生成成功。

    生成的證書會(huì)存在:/etc/letsencrypt/live/m.0794baidu.com/ 目錄下

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

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

    證書續(xù)期

    cerrbot的續(xù)期比原來的更加簡單,因?yàn)樽C書只有90天,所以建議使用crontab進(jìn)行自動(dòng)續(xù)期:

    crontab 里加上如下規(guī)則:0 3 */5 * * /root/certbot-auto renew --disable-hook-validation --renew-hook?"/etc/init.d/nginx reload"?這樣每5天就會(huì)執(zhí)行一次所有域名的續(xù)期操作。當(dāng)然時(shí)間也可以自行進(jìn)行調(diào)整,建議別太頻繁,因?yàn)樗麄兌加姓?qǐng)求次數(shù)的限制,如果需要強(qiáng)制更新可以在前面命令上加上 --force-renew 參數(shù)。

    注意事項(xiàng):

    1、因?yàn)槟J(rèn)LNMP的虛擬主機(jī)里是禁止 . 開頭的隱藏文件及目錄的,所以訪問http://abc.com/.well-known/acme-challenge/**** 這個(gè)鏈接的話返回403錯(cuò)誤,所以必須要將對(duì)應(yīng)虛擬主機(jī)配置文件里的
    location ~ /\.
    {
    deny all;
    }
    這段配置刪掉或注釋掉或在這段配置前面加上
    location ~ /.well-known {
    allow all;
    }

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

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

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

    3、國內(nèi)有些用戶反映會(huì)卡在Installing Python packages...這個(gè)地方不動(dòng),因?yàn)閜ip的默認(rèn)源是國外的,國內(nèi)可能會(huì)有點(diǎn)慢,可以執(zhí)行下面命令來修改pip源為國內(nèi)的:
    mkdir ~/.pip
    cat > ~/.pip/pip.conf <<EOF
    [global] index-url = https://pypi.doubanio.com/simple/

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

    執(zhí)行完,再重新運(yùn)行certbot的命令應(yīng)該正常安裝python的包了。

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

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

    >>轉(zhuǎn)載請(qǐng)注明出處:VPS偵探 本文鏈接地址:http://m.0794baidu.com/build/letsencrypt-certbot.html
    VPS偵探推薦:
    遨游主機(jī)、Vultr、Linode、搬瓦工LOCVPSKVMLA、HOSTKVM、HostXen80VPS美國VPS主機(jī),國內(nèi)推薦騰訊云阿里云。

    發(fā)表評(píng)論

    *必填

    *必填 (不會(huì)被公開)

    評(píng)論(33條評(píng)論)

    1. VPS偵探說道:

      @沒有l(wèi)ive文件夾, IP解析的對(duì)嗎?填寫的網(wǎng)站目錄正確嗎,看它去請(qǐng)求驗(yàn)證返回的文件是不對(duì)的

    2. 沒有l(wèi)ive文件夾說道:

      請(qǐng)問下在執(zhí)行命令:
      單域名生成證書:

      ./certbot-auto certonly xxxxxx

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

      提示信息為:

      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.

      請(qǐng)問下這是為什么呢

    3. VPS偵探說道:

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

    4. 偏執(zhí)者說道:

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

      Connection closed.

    5. 偏執(zhí)者說道:

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

    6. VPS偵探說道:

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

    7. xiangyudashu說道:

      軍哥 執(zhí)行完 ./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:

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

    8. VPS偵探說道:

      @LisonFan, 這個(gè)只是讓他來安裝依賴包,有這個(gè)提示肯定依賴包已經(jīng)安裝好了

    9. LisonFan說道:

      執(zhí)行完 ./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說道:

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

    12. VPS偵探說道:

      @Chilsion, 沒按要求裝epel吧

    13. Chilsion說道:

      CentOS 6.8 nginx環(huán)境。執(zhí)行
      cd /root/
      wget https://dl.eff.org/certbot-auto --no-check-certificate
      chmod +x ./certbot-auto
      ./certbot-auto -n
      后,出現(xiàn)以下錯(cuò)誤,請(qǐng)問怎么解決?
      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偵探說道:

      @邀請(qǐng)碼, 文章末尾自己找

    15. 邀請(qǐng)碼說道:

      http://bbs.vpser.net/邀請(qǐng)碼 是多少啊

    16. 555說道:

      驗(yàn)證碼

    主站蜘蛛池模板: 欧美国产综合在线V| www.日本在线视频| 精品视频导航| 国产精品美女主播| 国产精品久久久久影院日本| 99国产精品白浆在线观看免费| 日韩欧美亚洲精品| 久久久精品日本| 日本黄网免费一区二区精品| 97精品国产97久久久久久粉红| 国产日韩欧美在线| 欧美大香线蕉线伊人久久| 日韩国产欧美亚洲| 在线不卡日本| 伊人久久大香线蕉精品| 俺去了亚洲欧美日韩| 久久久国产精品视频| 欧美视频在线观看网站 | 国产高清不卡av| 国产日韩综合一区二区性色av| 久久国内精品一国内精品| 久久免费观看视频| 久久精品国亚洲| 国产精品我不卡| 国产精品免费成人| 国产精品日日做人人爱| 国产精品久久久久久久久免费| 国产美女扒开尿口久久久| 国产欧美自拍视频| 九九精品在线观看| 久久97精品久久久久久久不卡| 久久亚洲免费| 久久艹中文字幕| 久久福利视频导航| 国产自产在线视频一区| 国产日韩在线播放| 国产精品久久久久91| 91精品国产高清久久久久久91| 视频在线一区二区| 久无码久无码av无码| 国产精品美女www|