ubuntu18.04 用 cerbot 生成 Https 证书 ,配置 nginx 最近需要部署web服务,基于安全考虑,当然要支持流行的https。 https需要SSL证书, cerbot 免费的SSL证书是首选,虽然有90天期限限制,到期后需要续约。 这里用cerbot生成ssl证书,用nginx部署。 cerot的官网: https://certbot.eff.org/ # 安装cerot 1) 下载Certbot客户端:`wget https://dl.eff.org/certbot-auto` 2)下载后,进入下载的目录,添加执行权限:`chmod a+x ./certbot-auto` # 安装部署 nginx 此处省略,网上教程很多。 # 使用certbot-auto命令,生成证书 查看帮助:`./certbot-auto --help all ` 根据提示填写相应的信息。 执行完后,会在/etc/letsencrypt/live下 生成域名的文件夹,并且目录下会有pem文件。 nginx的https 访问,需要用到 pem 的证书文件: # 配置nginx支持https访问,测试 https的证书是否可用 设置Nginx配置文件,实现http和https同时访问 ``` server { listen 80;(监听80端口) listen 443 ssl;(监听443端口) server_name:(域名) #端口转发配置 location / { proxy_pass http://127.0.0.1:8090; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } ssl_certificate **/**/**chain.pem;(pem文件路径) ssl_certificate_key **/**/**key.pem;(pem文件路径) ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; } ``` ### # 重载nginx服务; `sudo nginx -s reload` # 然后用https访问自己的域名,检验是否成功 1,检查443端口,包括服务器上的防火墙是否开启443端口,服务器开启443命令如下: 开启443端口:`firewall-cmd --permanent --add-port=443/tcp` 查看是否成功:`firewall-cmd --permanent --query-port=443/tcp` 端口添加成功后,需要reload重新载入:`firewall-cmd --reload` 也可直接用 cerbot 的nginx 插件完成相关工作,可参见前文: steem.buzz [ ubuntu18.04 用 cerbot 自动生成 Https 证书 ](https://steem.buzz/hive-132971/@sherryzhou/ubuntu18-cerbot-https-20200323) hive.blog:[ ubuntu18.04 用 cerbot 自动生成 Https 证书 ](https://hive.blog/hive-132971/@sherryzhou/ubuntu18-cerbot-https-20200323) 本帖同步首发: steem.buzz [ ubuntu18.04 用 cerbot 生成 Https 证书 ,配置 nginx ](https://steem.buzz/hive-132971/@sherryzhou/ubuntu18-cerbot-https-20200326) hive.blog:[ ubuntu18.04 用 cerbot 生成 Https 证书 ,配置 nginx ](https://hive.blog/hive-132971/@sherryzhou/ubuntu18-cerbot-https-20200326)
post_id | 85,414,958 |
---|---|
author | sherryzhou |
permlink | ubuntu18-cerbot-https-20200326 |
category | hive-101145 |
json_metadata | {"app":"beem\/0.22.3","links":["https:\/\/steem.buzz\/hive-132971\/@sherryzhou\/ubuntu18-cerbot-https-20200323","https:\/\/steem.buzz\/hive-132971\/@sherryzhou\/ubuntu18-cerbot-https-20200326","https:\/\/hive.blog\/hive-132971\/@sherryzhou\/ubuntu18-cerbot-https-20200326","http:\/\/127.0.0.1:8090;","https:\/\/hive.blog\/hive-132971\/@sherryzhou\/ubuntu18-cerbot-https-20200323","https:\/\/dl.eff.org\/certbot-auto`","https:\/\/certbot.eff.org\/"],"tags":["hive-101145","hive-132971","cn","mini","jjm","cn-reader","esteem","steemleo","zzan","hive-143316","cn-curation","sct","sct-cn","sct-freeboard","dblog","whalepower","actnearn","neoxian","palnet","upfundme","lassecash","lifestyle","mediaofficials","busy","wherein","steempreak","cn-marlians","steem","hive","steem2hive"]} |
created | 2020-03-26 15:04:51 |
last_update | 2020-03-26 15:04:51 |
depth | 0 |
children | 0 |
net_rshares | 9,518,073,402,050 |
last_payout | 2020-04-02 15:04:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.228 SBD |
curator_payout_value | 1.164 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,964 |
author_reputation | 265,053,371,790,108 |
root_title | "ubuntu18.04 用 cerbot 生成 Https 证书 ,配置 nginx" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
justyy | 0 | 1,873,424,874,845 | 8.36% | ||
happyukgo | 0 | 444,359,556 | 8.36% | ||
virus707 | 0 | 170,467,566,262 | 1% | ||
robinlee | 0 | 748,237 | 8.36% | ||
rainyapril | 0 | 901,546 | 8.36% | ||
kikima | 0 | 25,710,543 | 8.36% | ||
geass | 0 | 14,610,270 | 8.36% | ||
superbing | 0 | 3,031,421,828 | 8.36% | ||
dailyfortune | 0 | 1,119,290,550 | 8.36% | ||
dailystats | 0 | 5,818,441,359 | 8.36% | ||
jianan | 0 | 2,914,265,599 | 8.36% | ||
anxin | 0 | 211,956,287 | 8.36% | ||
nean | 0 | 676,378 | 8.36% | ||
foodielifestyle | 0 | 0 | 8.36% | ||
woolfe19861008 | 0 | 176,218,675 | 8.36% | ||
dailychina | 0 | 3,799,962,960 | 8.36% | ||
vincenthan | 0 | 4,854,601 | 8.36% | ||
dongfengman | 0 | 1,058,977,013 | 8.36% | ||
serenazz | 0 | 69,063,840 | 8.36% | ||
yedda | 0 | 817,228 | 8.36% | ||
zasilla | 0 | 1,094,816 | 8.36% | ||
fishaa | 0 | 417,998,318 | 8.36% | ||
ethanlee | 0 | 319,793,392 | 8.36% | ||
twinsnicole | 0 | 1,361,522 | 8.36% | ||
deepthinking | 0 | 1,705,018 | 8.36% | ||
gogoabc | 0 | 415,228,258 | 8.36% | ||
fanso | 0 | 97,824,156 | 8.36% | ||
lilypang22 | 0 | 86,892,626 | 8.36% | ||
fishcc | 0 | 416,367,897 | 8.36% | ||
fishdd | 0 | 305,072,647 | 8.36% | ||
yuting | 0 | 358,764,365 | 8.36% | ||
lilyan | 0 | 362,170,472 | 8.36% | ||
zens | 0 | 1,571,966 | 8.36% | ||
andrewma | 0 | 320,640,028 | 1.67% | ||
steemitvip | 0 | 771,484 | 8.36% | ||
regals | 0 | 551,907 | 8.36% | ||
joelone | 0 | 1,623,487 | 8.36% | ||
sweet-jenny8 | 0 | 2,064,416,601 | 8.36% | ||
atinna | 0 | 418,684,416 | 8.36% | ||
moneybaby | 0 | 930,981,700 | 2.5% | ||
ffbank | 0 | 428,834,958 | 8.36% | ||
weicomenew | 0 | 467,655,622 | 8.36% | ||
laiyuehta | 0 | 338,797,898 | 8.36% | ||
turtlegraphics | 0 | 202,071,364 | 8.36% | ||
witnesstools | 0 | 648,283,293 | 8.36% | ||
ilovecoding | 0 | 627,859,246 | 8.36% | ||
steemfuckeos | 0 | 285,271,752 | 8.36% | ||
chorusmaster | 0 | 606,414,272 | 100% | ||
minigame | 0 | 197,680,207,391 | 0.6% | ||
jjm13 | 0 | 904,744,518 | 1% | ||
zzan.co17 | 0 | 0 | 30% | ||
cplusplus | 0 | 601,355,662 | 8.36% | ||
justsoso | 0 | 122,788,398 | 8.36% | ||
longhash | 0 | 567,581,155 | 8.36% | ||
cnlifes | 0 | 351,966,315 | 8.36% | ||
cnfish | 0 | 418,626,184 | 8.36% | ||
llfestyle | 0 | 385,437,547 | 8.36% | ||
dappcoder | 0 | 302,210,848,077 | 100% | ||
tex.fund | 0 | 489,205,823 | 100% | ||
hnt | 0 | 1,132,027,163 | 100% | ||
acu.fund | 0 | 2,710,093,538 | 100% | ||
mana.bank | 0 | 1,704,835,389 | 100% | ||
acu.fund.witness | 0 | 682,812,605 | 100% | ||
spbank | 0 | 3,436,796,282 | 100% | ||
yaowl | 0 | 572,225,250 | 100% | ||
alanyao | 0 | 2,010,566,065 | 100% | ||
missingwolf | 0 | 606,201,352 | 100% | ||
xinhuaren | 0 | 570,941,095 | 100% | ||
acufund | 0 | 561,265,763 | 100% | ||
downvoter | 0 | 129,769,827,621 | 100% | ||
manabot1 | 0 | 555,396,326 | 100% | ||
manabot | 0 | 563,919,428 | 100% | ||
huaren.news | 0 | 6,730,397,964,025 | 100% | ||
cameron.barnes | 0 | 1,299,622,396 | 100% | ||
manabot2 | 0 | 554,330,652 | 100% | ||
sherryzhou | 0 | 1,952,906,582 | 100% | ||
goodvoter | 0 | 642,327,586 | 100% | ||
anonymity.inlet | 0 | 496,255,998 | 100% | ||
manabot3 | 0 | 558,013,156 | 100% | ||
manabank | 0 | 537,270,089 | 100% | ||
texfund | 0 | 549,992,361 | 100% | ||
goodposter | 0 | 550,442,185 | 100% | ||
goodcurator | 0 | 2,516,453,457 | 100% | ||
goodauthor | 0 | 583,438,609 | 100% | ||
shanyi | 0 | 665,744,671 | 100% | ||
yuwenzhaobin | 0 | 45,649,290 | 100% | ||
huangyiru | 0 | 635,752,252 | 100% | ||
qiuruling | 0 | 661,325,930 | 100% | ||
tongpingxia | 0 | 59,189,220 | 100% | ||
fushuo | 0 | 734,512,779 | 100% | ||
downscaner | 0 | 614,627,375 | 100% | ||
wang.han | 0 | 616,987,330 | 100% | ||
anonym.inlet | 0 | 865,991,744 | 100% | ||
rongyongyu | 0 | 704,739,916 | 100% | ||
heyaochen | 0 | 1,148,840,730 | 100% | ||
miyijuan | 0 | 665,436,243 | 100% | ||
xiangsong | 0 | 559,081,910 | 100% | ||
haiyaochang | 0 | 137,843,669 | 100% | ||
zhangyanxie | 0 | 697,680,413 | 100% | ||
jiduanren | 0 | 641,192,703 | 100% | ||
hanyiya | 0 | 707,119,776 | 100% | ||
guxiefeng | 0 | 681,260,488 | 100% | ||
hejuangang | 0 | 822,613,393 | 100% | ||
mengyin | 0 | 735,823,311 | 100% | ||
liaohepeng | 0 | 931,951,113 | 100% | ||
gaituan | 0 | 719,902,680 | 100% | ||
quxibei | 0 | 642,302,454 | 100% | ||
huarennews | 0 | 601,415,409 | 100% | ||
qukehan | 0 | 117,187,849 | 100% | ||
lvziyun | 0 | 2,980,558,507 | 100% | ||
telangpu | 0 | 262,562,609 | 100% | ||
chinesebi | 0 | 22,412,226,596 | 100% | ||
erlcet | 0 | 418,663,569 | 8.36% | ||
staryao | 0 | 1,915,363,311 | 100% | ||
steeemmonsters | 0 | 418,677,846 | 8.36% | ||
maiydue | 0 | 418,651,811 | 8.36% | ||
wongshiylng | 0 | 418,639,090 | 8.36% | ||
deepcrypti8 | 0 | 418,651,790 | 8.36% | ||
myiord1992 | 0 | 418,655,059 | 8.36% | ||
wilhb82 | 0 | 418,677,908 | 8.36% | ||
morningshlne | 0 | 418,665,306 | 8.36% | ||
leodec | 0 | 418,684,373 | 8.36% | ||
william.turner | 0 | 41,274,493 | 100% | ||
alyssa.mey | 0 | 42,500,296 | 100% | ||
raven.mottram | 0 | 34,222,783 | 100% | ||
brian.shanno | 0 | 0 | 100% | ||
annmarie.prigge | 0 | 135,111,837 | 100% | ||
meaghan.dajer | 0 | 28,659,341 | 100% | ||
longye | 0 | 27,133,078 | 100% | ||
wangping | 0 | 26,388,971 | 100% | ||
likeqianq | 0 | 24,709,686 | 100% | ||
jinpingxi | 0 | 27,997,091 | 100% | ||
gavinyao | 0 | 38,188,386 | 100% | ||
dragon8king | 0 | 39,835,158 | 100% | ||
steem.buzz | 0 | 2,513,921,839 | 100% | ||
splinterislands | 0 | 343,288,118 | 8.36% | ||
keivinzhang | 0 | 343,290,871 | 8.36% | ||
gavin.yao | 0 | 748,605,556 | 100% | ||
wangfang | 0 | 455,887,608 | 100% | ||
zhangjin | 0 | 126,654,705 | 100% | ||
china.news | 0 | 36,387,187 | 100% | ||
mingji | 0 | 125,913,247 | 100% | ||
liuyan | 0 | 29,480,575 | 100% | ||
newcoder | 0 | 347,628,148 | 100% | ||
sunyuchen | 0 | 25,414,151 | 100% | ||
trxsun | 0 | 30,381,941 | 100% | ||
coderhappy | 0 | 146,253,523 | 100% | ||
gongsunyan | 0 | 0 | 100% | ||
siturenxiong | 0 | 40,282,451 | 100% | ||
yukaiyi | 0 | 36,624,823 | 100% | ||
news.bot | 0 | 39,372,708 | 100% | ||
douxili | 0 | 42,228,307 | 100% | ||
suckmydick | 0 | 275,667,092 | 8.36% | ||
chromebook | 0 | 276,776,629 | 8.36% | ||
voterking | 0 | 37,042,498 | 100% | ||
ericandryan | 0 | 930,977,444 | 8.36% | ||
hbi | 0 | 1,940,343,985 | 100% |