Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么必须要Ubuntu 18.10 以上?另附docker配置指南。 #1

Closed
trojan-tutor opened this issue Jul 16, 2019 · 1 comment
Closed

Comments

@trojan-tutor
Copy link
Owner

@trojan-tutor trojan-tutor commented Jul 16, 2019

我们选择选择Ubuntu 18.10 x64,这是trojan最低支持的Ubuntu操作系统版本,查看trojan支持的Ubuntu版本可以去这里。许多教程选择其他操作系统发行版本,但是配置过程和软件升级会比Ubuntu麻烦很多,所以还是建议大家选择Ubuntu。

Trojan不支持Ubuntu 18.04啦!最低系统版本是Ubuntu 18.10 x64。当然如果你想尝试一下docker的话,凡是能安装docker的基于x86_64架构的系统都是可以运行Trojan的,参考这里。建议采用docker运行trojan,宿主机运行nginx即可,docker运行nginx配置稍复杂,也没必要。

配置其实也简单,使用以下命令安装docker:

wget -qO- https://get.docker.com/ | sh

配置方面需要修改的是:

  1. trojan的配置文件可使用下面的命令下载到用户home目录
mkdir trojan
wget -O trojan/config.json https://raw.githubusercontent.com/trojan-gfw/trojan/master/examples/server.json-example
  1. 证书存放目录也和配置文件放在同一个地方
acme.sh --install-cert -d tdom.ml --key-file ~/trojan/private.key --fullchain-file ~/trojan/certificate.crt
  1. trojan的remote_addr和nginx监听的回环地址(127.0.0.1)都要改成虚拟网卡docker0的地址(Ubuntu中是172.17.0.1),可以通过ifconfig查看;

  2. 配置文件中的证书和密钥的路径修改为/config/

  3. trojan启动命令修改如下:

docker run -dt --name trojan -v ~/trojan:/config -p 443:443 trojangfw/trojan
  1. 部分系统nginx启动命令和Ubuntu不一样自己查一下。
@trojan-tutor trojan-tutor changed the title 为什么必须要Ubuntu 18.10 以上? 为什么必须要Ubuntu 18.10 以上?另附docker配置指南。 Jul 19, 2019
@trojan-tutor

This comment has been minimized.

Copy link
Owner Author

@trojan-tutor trojan-tutor commented Aug 1, 2019

教程已更新,现支持系统版本为:Ubuntu >= 16.04 or Debian >= 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.