Closed sjzbim closed 4 years ago
不需要看教程的,直接一键脚本即可安装的,不需要手动添加环境变量的
可以先试下程序自带的docker mysql安装,已经做了相应优化
gcp,centos7,一键安装脚本,安装时,总是卡在“2020-03-28 00:13:10 mysql启动中,请稍等...”这里;之前有两次过了这个,但是无法登录mysql,没有密码
docker run --name trojan-mysql --restart=always -p 16756:3306 -v /home/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=wGZFc -e MYSQL_ROOT_HOST=% -e MYSQL_DATABASE=trojan -d mysql/mysql-server:5.7 /usr/bin/docker-current: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. See '/usr/bin/docker-current run --help'. 2020-03-28 00:12:18 mysql启动中,请稍等... 2020-03-28 00:12:20 mysql启动中,请稍等... 2020-03-28 00:12:22 mysql启动中,请稍等... 2020-03-28 00:12:24 mysql启动中,请稍等... 2020-03-28 00:12:26 mysql启动中,请稍等... 2020-03-28 00:12:28 mysql启动中,请稍等... 2020-03-28 00:12:30 mysql启动中,请稍等... 2020-03-28 00:12:32 mysql启动中,请稍等... 2020-03-28 00:12:34 mysql启动中,请稍等... 2020-03-28 00:12:36 mysql启动中,请稍等... 2020-03-28 00:12:38 mysql启动中,请稍等... 2020-03-28 00:12:40 mysql启动中,请稍等... 2020-03-28 00:12:42 mysql启动中,请稍等... 2020-03-28 00:12:44 mysql启动中,请稍等... 2020-03-28 00:12:46 mysql启动中,请稍等... 2020-03-28 00:12:48 mysql启动中,请稍等... 2020-03-28 00:12:50 mysql启动中,请稍等... 2020-03-28 00:12:52 mysql启动中,请稍等... 2020-03-28 00:12:54 mysql启动中,请稍等... 2020-03-28 00:12:56 mysql启动中,请稍等... 2020-03-28 00:12:58 mysql启动中,请稍等... 2020-03-28 00:13:00 mysql启动中,请稍等... 2020-03-28 00:13:02 mysql启动中,请稍等... 2020-03-28 00:13:04 mysql启动中,请稍等... 2020-03-28 00:13:06 mysql启动中,请稍等... 2020-03-28 00:13:08 mysql启动中,请稍等... 2020-03-28 00:13:10 mysql启动中,请稍等... 2020-03-28 00:13:12 mysql启动中,请稍等... 2020-03-28 00:13:14 mysql启动中,请稍等... 2020-03-28 00:13:16 mysql启动中,请稍等... 2020-03-28 00:13:18 mysql启动中,请稍等... 2020-03-28 00:13:20 mysql启动中,请稍等... 2020-03-28 00:13:22 mysql启动中,请稍等... 2020-03-28 00:13:24 mysql启动中,请稍等... 2020-03-28 00:13:26 mysql启动中,请稍等... 2020-03-28 00:13:28 mysql启动中,请稍等... 2020-03-28 00:13:30 mysql启动中,请稍等... 2020-03-28 00:13:32 mysql启动中,请稍等... 2020-03-28 00:13:34 mysql启动中,请稍等... 2020-03-28 00:13:36 mysql启动中,请稍等... 2020-03-28 00:13:38 mysql启动中,请稍等... 2020-03-28 00:13:40 mysql启动中,请稍等... 2020-03-28 00:13:42 mysql启动中,请稍等... 2020-03-28 00:13:44 mysql启动中,请稍等... 2020-03-28 00:13:46 mysql启动中,请稍等... 2020-03-28 00:13:48 mysql启动中,请稍等... 2020-03-28 00:13:50 mysql启动中,请稍等... 2020-03-28 00:13:52 mysql启动中,请稍等... 2020-03-28 00:13:54 mysql启动中,请稍等... 2020-03-28 00:13:56 mysql启动中,请稍等... 2020-03-28 00:13:58 mysql启动中,请稍等... 2020-03-28 00:14:00 mysql启动中,请稍等... 2020-03-28 00:14:02 mysql启动中,请稍等... 2020-03-28 00:14:04 mysql启动中,请稍等... 2020-03-28 00:14:06 mysql启动中,请稍等... 2020-03-28 00:14:08 mysql启动中,请稍等... 2020-03-28 00:14:10 mysql启动中,请稍等... 2020-03-28 00:14:12 mysql启动中,请稍等... 2020-03-28 00:14:14 mysql启动中,请稍等... 2020-03-28 00:14:16 mysql启动中,请稍等... 2020-03-28 00:14:18 mysql启动中,请稍等... 2020-03-28 00:14:20 mysql启动中,请稍等...
@sjzbim docker安装失败了. 你可以试下用官方docker安装脚本sh <(curl -sL https://get.docker.com)
, 先安装成功docker再安装本程序. 运行完后docker info看下正不正常
我再优化下docker安装这块,估计换成用官方脚本来安装,提高成功率
@sjzbim 2.3.3版本已优化docker安装,优先使用官方脚本进行安装, 麻烦帮测试下在gcp上的docker安装
@sjzbim docker安装失败了. 你可以试下用官方docker安装脚本
sh <(curl -sL https://get.docker.com)
, 先安装成功docker再安装本程序. 运行完后docker info看下正不正常 gcp,centos 7, 官方脚本安装docker,貌似失败吧~ [root@trojan-panel ~]# docker info Client: Debug Mode: false
Server: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? errors pretty printing info
systemctl start docker
官方脚本安装完是没启动的,需要手动启动下
官方脚本安装完是没启动的,需要手动启动下 手动启动后
[root@trojan-panel ~]# systemctl start docker [root@trojan-panel ~]# docker info Client: Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.8
Storage Driver: overlay2
Backing Filesystem:
docker run --name trojan-mysql --restart=always -p 16756:3306 -v /home/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=wGZFc -e MYSQL_ROOT_HOST=% -e MYSQL_DATABASE=trojan -d mysql/mysql-server:5.7 试下运行,看下有没报错了
[root@trojan-panel ~]# docker run --name trojan-mysql --restart=always -p 16756:3306 -v /home/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=wGZFc -e MYSQL_ROOT_HOST=% -e MYSQL_DATABASE=trojan -d mysql/mysql-server:5.7 docker: Error response from daemon: Conflict. The container name "/trojan-mysql" is already in use by container "64b59adf2f98163005eb119a94d3437aab67898fd6c8040981cf2f8c036bd220". You have to remove (or rename) that container to be able to reuse that name. See 'docker run --help'. [root@trojan-panel ~]#
我删除了以上container,重新trojan,安装mysql,依然卡在 mysql启动中,请稍等……
要清理掉mysql数据, rm -rf /home/mysql 以及清理容器 docker rm -f trojan-mysql 这才算彻底清理mysql
清理了之后,重新运行trojan 安装mysql还是 启动中~
是会有启动中的,因为要等mysql启动完来自动创建表和用户
是会有启动中的,因为要等mysql启动完来自动创建表和用户
就是时间比较长,2分钟以上了
正常不会这么长,应该有问题才这么久。退出来 docker ps看下容器状态
还有有没有重装系统来试下呢,如果用之前的环境来测,用的还是二进制的docker安装方式
我新建了系统,再试一遍一键脚本
麻烦了👍
全新系统centos7,1.7g内存(之前600多),这次使用的网页ssh,一键脚本source <(curl -sL https://git.io/trojan-install) Created symlink from /etc/systemd/system/multi-user.target.wants/trojan-web.service to /etc/systemd/system/trojan-w eb.service. -bash: trojan: command not found 安装trojan管理程序成功! 运行命令trojan可进行trojan管理 -bash: trojan: command not found 浏览器访问'https://域名'可在线trojan多用户管理
mysql建用户能成功不
手动添加路径,正在安装trojan
正在安装mysql
mysql启动了 但是证书貌似没有申请成功,配置文件里面没有证书
报什么日志错误申请证书
[Sat Mar 28 12:04:27 UTC 2020] Lets find script dir. [Sat Mar 28 12:04:27 UTC 2020] SCRIPT='/root/.acme.sh/acme.sh' [Sat Mar 28 12:04:27 UTC 2020] _script='/root/.acme.sh/acme.sh' [Sat Mar 28 12:04:27 UTC 2020] _script_home='/root/.acme.sh' [Sat Mar 28 12:04:27 UTC 2020] Using config home:/root/.acme.sh https://github.com/acmesh-official/acme.sh v2.8.6 [Sat Mar 28 12:04:27 UTC 2020] Running cmd: issue [Sat Mar 28 12:04:27 UTC 2020] _main_domain='sese.ml' [Sat Mar 28 12:04:27 UTC 2020] _alt_domains='no' [Sat Mar 28 12:04:27 UTC 2020] Using config home:/root/.acme.sh [Sat Mar 28 12:04:27 UTC 2020] ACME_DIRECTORY='https://acme-v02.api.letsencrypt.org/directory' [Sat Mar 28 12:04:27 UTC 2020] DOMAIN_PATH='/root/.acme.sh/sese.ml_ecc' [Sat Mar 28 12:04:27 UTC 2020] Using ACME_DIRECTORY: https://acme-v02.api.letsencrypt.org/directory [Sat Mar 28 12:04:27 UTC 2020] _init api for server: https://acme-v02.api.letsencrypt.org/directory [Sat Mar 28 12:04:27 UTC 2020] GET [Sat Mar 28 12:04:27 UTC 2020] url='https://acme-v02.api.letsencrypt.org/directory' [Sat Mar 28 12:04:27 UTC 2020] timeout= [Sat Mar 28 12:04:27 UTC 2020] _CURL='curl -L --silent --dump-header /root/.acme.sh/http.header -g ' [Sat Mar 28 12:04:28 UTC 2020] ret='0' [Sat Mar 28 12:04:28 UTC 2020] ACME_KEY_CHANGE='https://acme-v02.api.letsencrypt.org/acme/key-change' [Sat Mar 28 12:04:28 UTC 2020] ACME_NEW_AUTHZ [Sat Mar 28 12:04:28 UTC 2020] ACME_NEW_ORDER='https://acme-v02.api.letsencrypt.org/acme/new-order' [Sat Mar 28 12:04:28 UTC 2020] ACME_NEW_ACCOUNT='https://acme-v02.api.letsencrypt.org/acme/new-acct' [Sat Mar 28 12:04:28 UTC 2020] ACME_REVOKE_CERT='https://acme-v02.api.letsencrypt.org/acme/revoke-cert' [Sat Mar 28 12:04:28 UTC 2020] ACME_AGREEMENT='https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf' [Sat Mar 28 12:04:28 UTC 2020] ACME_NEW_NONCE='https://acme-v02.api.letsencrypt.org/acme/new-nonce' [Sat Mar 28 12:04:28 UTC 2020] ACME_VERSION='2' [Sat Mar 28 12:04:28 UTC 2020] Le_NextRenewTime [Sat Mar 28 12:04:28 UTC 2020] _on_before_issue [Sat Mar 28 12:04:28 UTC 2020] _chk_main_domain='sese.ml' [Sat Mar 28 12:04:28 UTC 2020] _chk_alt_domains [Sat Mar 28 12:04:28 UTC 2020] Le_LocalAddress [Sat Mar 28 12:04:28 UTC 2020] d='sese.ml' [Sat Mar 28 12:04:28 UTC 2020] Check for domain='sese.ml' [Sat Mar 28 12:04:28 UTC 2020] _currentRoot='no' [Sat Mar 28 12:04:28 UTC 2020] Standalone mode. [Sat Mar 28 12:04:28 UTC 2020] _checkport='80' [Sat Mar 28 12:04:28 UTC 2020] _checkaddr [Sat Mar 28 12:04:28 UTC 2020] Using: ss [Sat Mar 28 12:04:28 UTC 2020] LISTEN 0 128 [::]:80 [::]:* users:(("trojan",pid=1415,fd=3)) [Sat Mar 28 12:04:28 UTC 2020] tcp port 80 is already used by 80 [ [Sat Mar 28 12:04:28 UTC 2020] Please stop it first [Sat Mar 28 12:04:28 UTC 2020] _on_before_issue.
先systemctl stop trojan-web 再去申请证书, 申请完后systemctl start trojan-web
"type": "urn:ietf:params:acme:error:rateLimited", "detail": "Error creating new order :: too many certificates already issued for exact set of domains: sese.ml: see https://letsencrypt.org/docs/rate-limits/", "status": 429 这个就尴尬了,只能换域名了吧?
嗯没有新域名就隔天试试
我换一个事实哈
有点想解决那个路径问题,可惜没有gcp机器来做验证😂
我没有换域名,申请了通配符证书,手动修改了root/config.json,添加了证书路径,配置算是成功了,trojan可以用了,面板也OK。 有两个问题:1.config没添加key也可以使用, 2.web面板没有强制https,http和https都可以访问
做不了强制https,因为trojan本身占了443端口,管理程序控制不到这个操作, 程序只起了80的端口
做不了强制https,因为trojan本身占了443端口,管理程序控制不到这个操作, 程序只起了80的端口
不用key也可以使用trojan吗
那就不清楚了,正常应该不是这样。能使用就好
我在root找的生成的配置文件,不知道原始配置文件在哪里
/usr/local/etc/trojan 找到了配置文件,里面有crt和key 但用trojan命令,生成配置文件内没有cert和key文件,如果这样的话,在电脑端配置起来就比较麻烦了~建议添加选项让用户自己导出cert、key和json配置文件,便于在mac和win使用
太繁琐了,你直接用trojan://链接导入就好
https://github.com/TheWanderingCoel/Trojan-Qt5 可以用这个扫描二维码或者导入trojan://链接
https://github.com/TheWanderingCoel/Trojan-Qt5 可以用这个扫描二维码或者导入trojan://链接
这个感觉还不是很稳定,用terminal那个+surge(sock5)好用些~
有点想解决那个路径问题,可惜没有gcp机器来做验证😂
申请一个呗,不是有免费300刀那个服务么?我记得,绑定招商visa就可以
费事了为了这个特意搞个双币信用卡
费事了为了这个特意搞个双币信用卡
双币可能不行吧,单独visa应该可以,还没有年费,哈哈哈~~
额。。我有个闲置的谷歌云 要不 拿去测试下
@xnknown 可以的😀
方便的话留个tg号联系 @xnknown
路径问题就谷歌云的服务器有问题,不知道为啥没把 /usr/local/bin 这个路径加入到环境变量,也许它的是最小化系统吧。阿里云的就没问题。
@luoqiz 确实其他vps我也没见过不将/usr/local/bin加入环境变量的,所以不好测试
添加路径(执行代码) echo 'export PATH=$PATH:/usr/local/bin' > /etc/profile.d/ulb.sh source /etc/profile.d/ulb.sh
出处:http://tj.6finger.at:8080/2020/03/23/trojan-%e5%a4%9a%e7%94%a8%e6%88%b7%e9%9d%a2%e6%9d%bf%e6%90%ad%e5%bb%ba/