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

如果出错了要这个命令

 certbot --authenticator webroot --installer apache 

再测试

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

systemctl enable strongswan
systemctl start strongswan
先确认 /etc/letsencrypt/live/mydomain.com/ 下面有你的证书文件
fullchain.pem,privkey.pem,chain.pem
然后用这几个命令,注意,下面的mydomain.com改成你自己的域名
ln -s /etc/letsencrypt/live/mydomain.com/fullchain.pem /etc/strongswan/ipsec.d/certs/fullchain.pem
ln -s /etc/letsencrypt/live/mydomain.com/privkey.pem /etc/strongswan/ipsec.d/private/privkey.pem
ln -s /etc/letsencrypt/live/mydomain.com/chain.pem /etc/strongswan/ipsec.d/cacerts/chain.pem

修改/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的更多相关文章

  1. Let's Encrypt:初次使用免费的ssl证书,并生成java用的 jks(keystore) 文件

    现在都流行 https,今天晚上花了二个小时,学习了一下,这里做个学习总结: 因为刚开始接触,就使用免费的:Let's Encrypt Let's Encrypt证书特点: 1. 现在主流的浏览器(c ...

  2. 免费SSL证书 之Let’s Encrypt申请与部署(Windows Nginx)

    我着着皇帝的新衣,但是你看不见    有一颗愿意等待的心,说明你对未来充满希望.有一颗充满希望的心,那么等待又算什么.人就是在等待与希望中度过,我们永远要对未来充满信心! 读在最前面: 1.本文案例为 ...

  3. HashTable初次体验

    用惯了数组.ArryList,初次接触到HashTable.Dictionary这种字典储存对于我来说简直就是高大上. 1.到底什么是HashTable HashTable就是哈希表,和数组一样,是一 ...

  4. 初次启动app校验的活动图和分析

    初次启动活动图 version 1 version 2 version 3 根据上图的活动图分析,可能存在较严重的问题: 主线程中如果发现是sdcard的url,则可能进行重命名 FirstEnter ...

  5. 百度地图API试用--(初次尝试)

    2016-03-17: 百度地图API申请key的步骤相对简单,不做过多阐述. 初次使用百度地图API感觉有点神奇,有些功能加进来以后有点问题,注释掉等有空再解决. 代码如下: <%@ page ...

  6. [masmplus]初次使用报external symbol _start 是配置问题

    初次使用masmplus 其中在 codesg segment 使用了 start 标记, 并在end处标明了:end  start  但是默认的masmplus 会提示 start 为 不认识的 e ...

  7. Let’s Encrypt 配置

    刚配置了下Let's Encrypt,chrome浏览器里有绿条出来,看官网其它平台问题应该也不大.我还没有研究这个工作原理,关键是刚花了几千块给公司买了个收费的证书认证.这里写下配置过程(https ...

  8. 使用Let`s encrypt 免费的https 证书

    在iOS上以前暂时屏蔽https使用http的接口,将在未来被苹果拒绝: 之前传苹果会在2017年1月1日强制要求支持https,但是现在苹果又延迟该计划了 https://developer.app ...

  9. 初次接触json...

    这两天发现很多网站显示图片版块都用了瀑布流模式布局的:随着页面滚动条向下滚动,这种布局还会不断加载数据并附加至当前尾部.身为一个菜鸟级的程序员,而且以后可能会经常与网站打交道,我觉得我还是很有必要去尝 ...

随机推荐

  1. bzoj 1833: [ZJOI2010]count 数字计数【数位dp】

    非典型数位dp 先预处理出f[i][j][k]表示从后往前第i位为j时k的个数,然后把答案转换为ans(r)-ans(l-1),用预处理出的f数组dp出f即可(可能也不是dp吧--) #include ...

  2. bzoj 1651: [Usaco2006 Feb]Stall Reservations 专用牛棚【贪心+堆||差分】

    这个题方法还挺多的,不过洛谷上要输出方案所以用堆最方便 先按起始时间从小到大排序. 我用的是greater重定义优先队列(小根堆).用pair存牛棚用完时间(first)和牛棚编号(second),每 ...

  3. 聊聊LuaJIT

    JIT 什么是JITJIT = Just In Time即时编译,是动态编译的一种形式,是一种优化虚拟机运行的技术. 程序运行通常有两种方式,一种是静态编译,一种是动态解释,即时编译混合了这二者.Ja ...

  4. Java 8 Stream API的使用示例

    前言 Java Stream API借助于Lambda表达式,为Collection操作提供了一个新的选择.如果使用得当,可以极大地提高编程效率和代码可读性. 本文将介绍Stream API包含的方法 ...

  5. 洛谷 P1064 金明的预算方案(有依赖的背包问题)

    题目描述 金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间金明自己专用的很宽敞的房间.更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”.今 ...

  6. C. Coin Troubles 有依赖的背包 + 完全背包变形

    http://codeforces.com/problemset/problem/283/C 一开始的时候,看着样例不懂,为什么5 * a1 + a3不行呢?也是17啊 原来是,题目要求硬币数目a3 ...

  7. [转]MySQL存储过程

    转自:http://www.cnblogs.com/exmyth/p/3303470.html 14.1.1 创建存储过程 MySQL中,创建存储过程的基本形式如下: CREATE PROCEDURE ...

  8. YumRepo Error: All mirror URLs are not using ftp, http[s] or file

    有台机器使用Yum的时候,报错如下: YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. $releaseve ...

  9. SQLServer2005 维护计划 无法删除

    1.查看"维护计划"对象的ID use msdbselect * from sysmaintplan_plansselect * from sysmaintplan_logsele ...

  10. cocos2d-x win7 部署

    1. 安装 下载python  https://www.python.org/downloads/release/python-279/ 2.从官网下载cocos2d-x  http://www.co ...