环境
系统:CentOS7
WEB Server:Nginx
域名:namecheap(付费域名)
CND:Cloudflare
域名托管
将域名托管给Cloudflare,更改namecheap中的nameserver为Cloudflare
在Cloudflare中配置域名并绑定IP
等待一段时间等到域名生效,Cloudflare变成为Active状态,且能ping通方可进行下一步。
Trojan安装
1 2 3 4 5 6
| yum install -y wget
curl https://get.acme.sh | sh
wget -N --no-check-certificate -q -O trojan_install.sh "https://raw.githubusercontent.com/xyz690/Trojan/master/trojan_install.sh" && chmod +x trojan_install.sh && bash trojan_install.sh
|
输入www域名
自动安装证书失败
经过手动安装证书和安装trojan2.sh等其他脚本误打误撞证书安装成功。
卸载重装后成功。
手动安装证书
old
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| yum install socat
curl https://get.acme.sh | sh source ~/.bashrc
acme.sh --register-account -m EMAIL@example.com --server zerossl
acme.sh --server zerossl --issue -d YOURDOMAIN.COM --dns dns_cf
sudo ~/.acme.sh/acme.sh --installcert -d MYDOMAIN --fullchainpath /etc/crt/autumn.crt --keypath /etc/crt/autumn.key
|
New
1 2 3 4 5 6 7 8
| curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --issue -d $your_domain --nginx
~/.acme.sh/acme.sh --installcert -d $your_domain --key-file /usr/local/etc/trojan/private.key --fullchain-file /usr/local/etc/trojan/cert.crt
~/.acme.sh/acme.sh --upgrade --auto-upgrade
|
Trojan命令
1 2 3 4 5
| systemctl status trojan.service
cat /usr/src/trojan-macos/trojan/config.json
|
Trojan客户端
安卓&windows: V2rayN客户端
IOS&MAC: shadowrocket
添加trojan服务器,输入IP、端口、密码即可
其他一键安装trojan
1 2 3 4 5 6 7 8 9
| wget -N --no-check-certificate "https://raw.githubusercontent.com/V2RaySSR/Trojansh/master/trojan1.sh" && chmod +x trojan1.sh && ./trojan1.sh
wget -N --no-check-certificate "https://raw.githubusercontent.com/V2RaySSR/Trojansh/master/trojan2.sh" && chmod +x trojan2.sh && ./trojan2.sh
wget -N --no-check-certificate "https://raw.githubusercontent.com/V2RaySSR/Trojansh/master/trojan3.sh" && chmod +x trojan3.sh && ./trojan3.sh
wget -N --no-check-certificate "https://github.com/ylx2016/Linux-NetSpeed/releases/download/sh/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
|