初次使用Let's encrypt
wget --no-check-certificate -O shadowsocks.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
chmod +x shadowsocks.sh
./shadowsocks.sh 2>&1 | tee shadowsocks.log 完成后这这样
Congratulations, Shadowsocks-python server install completed!
Your Server IP :your_server_ip
Your Server Port :your_server_port
Your Password :your_password
Your Encryption Method:your_encryption_method Welcome to visit:https://teddysun.com/342.html
Enjoy it! 然后用 vi /etc/shadowsocks.json 把里面的配置修改 启动:/etc/init.d/shadowsocks start
停止:/etc/init.d/shadowsocks stop
重启:/etc/init.d/shadowsocks restart
状态:/etc/init.d/shadowsocks status 建立Let's encrypt sudo yum install epel-release
sudo yum install httpd mod_ssl python-certbot-apache
sudo systemctl start httpd
sudo firewall-cmd --add-service=http
sudo firewall-cmd --add-service=https
sudo firewall-cmd --runtime-to-permanent
sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT
然后建立证书比如要建立一个二级域名sub.example.com
sudo certbot --apache -d sub.example.com
如无意外会出现如下
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/example.com/fullchain.pem. Your cert
will expire on 2016-04-21. To obtain a new version of the
certificate in the future, simply run Let's Encrypt again.
- If you lose your account credentials, you can recover through
e-mails sent to user@example.com.
- Your account credentials have been saved in your Let's Encrypt
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Let's
Encrypt so making regular backups of this folder is ideal.
- If you like Let's Encrypt, 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
如果出错了要这个命令
再测试
sudo apachectl configtest
再重启
sudo systemctl restart httpd
这时相信你可以访问你的https网站
这时要设置自动更新你的证书
sudo certbot renew
再用定时做个自动更新证书
sudo crontab -e
进入后输入这个命令行
30 2 * * * /usr/bin/certbot renew >> /var/log/le-renew.log
好了,然后再做个ikev2服务器
yum install strongswan
修改/etc/strongswan/ipsec.conf,注意下面 leftid=server.mydomain.com 要改成自己的域名
config setup
uniqueids=no charon
debug = ike 3, cfg 3
conn %default
dpdaction=clear
dpddelay=35s
dpdtimeout=2000s
keyexchange=ikev2
auto=add
rekey=no
reauth=no
fragmentation=yes
compress=yes
### left - local (server) side
# filename of certificate chain located in /etc/strongswan/ipsec.d/certs/
leftcert=fullchain.pem
leftsendcert=always
leftsubnet=0.0.0.0/0,::/0
### right - remote (client) side
eap_identity=%identity
rightsourceip=10.1.1.0/24,2a00:1450:400c:c05::/112
rightdns=8.8.8.8,2001:4860:4860::8888
conn ikev2-mschapv2
rightauth=eap-mschapv2
conn ikev2-mschapv2-apple
rightauth=eap-mschapv2 leftid=server.mydomain.com
然后再改 /etc/strongswan/ipsec.secrets 根据自己改自己用户名和密码改下面的yonghuaming : EAP "mima"
# filename of private key located in /etc/strongswan/ipsec.d/private/
: RSA privkey.pem
# syntax is `username : EAP "plaintextpassword"`
yonghuaming : EAP "mima"
然后开启防火墙
firewall-cmd --zone=public --permanent --add-rich-rule='rule protocol value="esp" accept’
firewall-cmd --zone=public --permanent --add-rich-rule='rule protocol value="ah" accept'
firewall-cmd --zone=public --permanent --add-port=500/udp
firewall-cmd --zone=public --permanent --add-port=4500/udp
firewall-cmd --zone=public --permanent --add-service="ipsec"
firewall-cmd --zone=public --permanent --add-masquerade
firewall-cmd --reload
保存设置
firewall-cmd --list-all
再加些东西到 /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
然后使它生效
sysctl -p
全部完成了!
初次使用Let's encrypt的更多相关文章
- Let's Encrypt:初次使用免费的ssl证书,并生成java用的 jks(keystore) 文件
现在都流行 https,今天晚上花了二个小时,学习了一下,这里做个学习总结: 因为刚开始接触,就使用免费的:Let's Encrypt Let's Encrypt证书特点: 1. 现在主流的浏览器(c ...
- 免费SSL证书 之Let’s Encrypt申请与部署(Windows Nginx)
我着着皇帝的新衣,但是你看不见 有一颗愿意等待的心,说明你对未来充满希望.有一颗充满希望的心,那么等待又算什么.人就是在等待与希望中度过,我们永远要对未来充满信心! 读在最前面: 1.本文案例为 ...
- HashTable初次体验
用惯了数组.ArryList,初次接触到HashTable.Dictionary这种字典储存对于我来说简直就是高大上. 1.到底什么是HashTable HashTable就是哈希表,和数组一样,是一 ...
- 初次启动app校验的活动图和分析
初次启动活动图 version 1 version 2 version 3 根据上图的活动图分析,可能存在较严重的问题: 主线程中如果发现是sdcard的url,则可能进行重命名 FirstEnter ...
- 百度地图API试用--(初次尝试)
2016-03-17: 百度地图API申请key的步骤相对简单,不做过多阐述. 初次使用百度地图API感觉有点神奇,有些功能加进来以后有点问题,注释掉等有空再解决. 代码如下: <%@ page ...
- [masmplus]初次使用报external symbol _start 是配置问题
初次使用masmplus 其中在 codesg segment 使用了 start 标记, 并在end处标明了:end start 但是默认的masmplus 会提示 start 为 不认识的 e ...
- Let’s Encrypt 配置
刚配置了下Let's Encrypt,chrome浏览器里有绿条出来,看官网其它平台问题应该也不大.我还没有研究这个工作原理,关键是刚花了几千块给公司买了个收费的证书认证.这里写下配置过程(https ...
- 使用Let`s encrypt 免费的https 证书
在iOS上以前暂时屏蔽https使用http的接口,将在未来被苹果拒绝: 之前传苹果会在2017年1月1日强制要求支持https,但是现在苹果又延迟该计划了 https://developer.app ...
- 初次接触json...
这两天发现很多网站显示图片版块都用了瀑布流模式布局的:随着页面滚动条向下滚动,这种布局还会不断加载数据并附加至当前尾部.身为一个菜鸟级的程序员,而且以后可能会经常与网站打交道,我觉得我还是很有必要去尝 ...
随机推荐
- Bug分支(转载)
转自:http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137602359178 ...
- Rails 插入代码与注释
醉了醉了,在原来那个表格最后加了然后更新博客,然后最后写的内容就没了.来来回回试了n次都一样.不得已新开一个 插入代码 <% ... %> 打印值 <%= ... %&g ...
- 2017青岛网络赛1011 A Cubic number and A Cubic Number
A Cubic number and A Cubic Number Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/3276 ...
- 类支付宝密码输入框NumberEditText(简单粗暴的定制方式)
因为项目需要,设计了一个下图样的验证码输入框(ps:个人认为还不如直接一个EditText,用户友好度可能更好,何况这页面99.9%的用户不会使用,但是没办法,别人才是专业的设计师). 其实界面很简单 ...
- Jmeter的属性和变量
jmeter的属性和变量可以简单理解为编程里面的全局变量和局部变量.属性是全局可见,可以跨线程组传递调用,而变量基本上只能存在于一个线程组中(在测试计划定义的变量也是可以跨线程组传递的).同线程组内的 ...
- Shell printf命令
Shell 的另一个输出命令 printf.默认 printf 不会像 echo 自动添加换行符,我们可以手动添加 \n. #!/bin/bash printf "%-10s %-8s %- ...
- js延时加载的方法
js的延迟加载有助与提高页面的加载速度,以下是延迟加载的几种方法: 1.使用setTimeout延迟方法的加载时间 延迟加载js代码,给网页加载留出更多时间 <script type=" ...
- 梦想CAD控件安卓界面控制
CAD控件界面上所有元素都可以控制显示或隐藏,下面将逐一介绍详细用法. 设置工具文件 MxFunction.setToolFile 设置工具文件.详细说明如下: 参数 说明 String sFile ...
- 01JavaScript使用
JavaScript使用 1.内容写入 HTML <P onmouseover="alert('欢迎您学习JavaScript!')">鼠标移过来</P> ...
- 配置redis三主三从
主从环境 centos7.6 redis4.0.1 主 从 192.168.181.139:6379 192.168.181.136:6379 192.168.181.136:6380 192.168 ...