使用过程中遇到问题,欢迎到 网络跳越论坛 或 tg群组https://t.me/hijkclub 交流,或关注Youtube频道:网络跳越
trojan是基于https协议的工具,而https又是目前网站的主流协议,因此搭建好trojan后顺便整一个网站是完全没问题的,也能让trojan更安全,ip更不容易被墙。 本教程介绍trojan建站的详细过程。
首先,建议网站的主机名用 www 或者 @,即网站是通过 https://www.v2raytech.com 或者 https://v2raytech.com 这样的形式访问。当然blog、app等主机名也是很好的,访问形式就是 https://blog.v2raytech.com、https://app.v2raytech.com。
接着域名解析到vps的ip,运行 trojan一键脚本 搭建好trojan,并确保trojan能在手机、电脑上配置正常使用。
脚本中已经给出了静态网站、小说站、美女站、VPS优惠博客等多种类型选择。如果你想搭建WordPress博客,请参考下文中的教程。
WordPress一键脚本
WordPress是非常流行的建站程序、CMS系统,国外许多知名网站都是用WordPress搭建,本站也是基于WordPress。
WordPress建站需要配置PHP、MySQL/MariaDB,安装和配置过程比较复杂。本人借鉴 WordPress一键脚本 提供一个适用于CentOS 7/8、Debian/Ubuntu系统的WordPress一键脚本,使用方法如下:
bash <(curl -sL https://s.hijk.art/wordpress_trojan.sh)
脚本运行后会询问你是否继续,按回车键继续,接着脚本会自动运行并配置Nginx。运行成功后输出类似如下的配置信息:
接下来,浏览器打开域名,进入WordPress的配置界面:
填好必要的信息,点击下方的“安装WordPress”,恭喜你,属于你的博客就搭建好了!接下来尽情折腾博客,开始你的写文章之旅吧!
如果打算认真写博客且长期使用,建议参考:WordPress插件推荐及性能优化建议
其他
1. 运行wordpress脚本后,trojan也能正常使用,不会受到影响;
2. 其他问题请到 网络跳越论坛 反馈。
119 条评论
along · 2020年11月11日 16:20
您好大神!
查看了一下config.json文件
[email protected]:~# vi /usr/local/etc/trojan/config.json
{
“run_type”: “server”,
“local_addr”: “0.0.0.0”,
“local_port”: 443,
“remote_addr”: “www.5******.com”,
“remote_port”: 443,
…… …… ……
发现 “local_addr”是”0.0.0.0″,回想我的域名链接不到 http://www.5******.com,是不是与这行地址有关?如果是,应该怎样处理?
威龙 · 2020年11月11日 16:57
不是这个原因,连接不到那个域名,说明这个域名无法在你的vps上解析,这是正常的,换一个域名就好了
along · 2020年11月11日 19:12
换了“imeizi.me”、“www.imeizi.me”、“https://imeizi.me”、“www.baidu.com”还是进不去
yang 洋 · 2020年8月15日 20:20
为什么修改好之后会出现:
400 Bad Request
The plain HTTP request was sent to HTTPS port
cloudflare
跳越者 · 2020年8月15日 20:43
你的端口弄错了吧?
sees · 2020年6月27日 09:42
请问这是什么原因呢?安装最后一步出现这个,最后显示WordPress安装成功!
但是还是不能访问
mv: target ‘bigmeesun.cn’ is not a directory
/dev/fd/63: line 132: cd: too many arguments
cp: cannot stat ‘wp-config-sample.php’: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
Can’t open wp-config.php: No such file or directory.
chown: cannot access ‘/var/www/xxxcccfff.cn’: No such file or directory
chown: cannot access ‘xxxcccfff.cn’: No such file or directory
/dev/fd/63: line 153: /etc/nginx/conf.d/${domain}.conf: ambiguous redirect
跳越者 · 2020年6月27日 10:38
这些输出说明脚本运行过程中有问题
tested · 2020年6月27日 11:03
报错信息:
Failed to set locale, defaulting to C.UTF-8
还有就还是之前的错误
mv: target ‘bigmeesun.cn’ is not a directory
/dev/fd/63: line 132: cd: too many arguments
cp: cannot stat ‘wp-config-sample.php’: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “zh_CN.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
Can’t open wp-config.php: No such file or directory.
chown: cannot access ‘/var/www/bigmeesun.cn’: No such file or directory
chown: cannot access ‘bigmeesun.cn’: No such file or directory
/dev/fd/63: line 153: /etc/nginx/conf.d/${domain}.conf: ambiguous redirect|
test · 2020年6月27日 11:05
还是说这些文件需要自己手动建啊
跳越者 · 2020年6月27日 13:51
正常来说运行脚本就行了,不需要手动配置,你这问题好像是无法创建文件夹,看看是不是硬盘满了?
test · 2020年6月27日 14:08
/dev/vda1 25736400 2930828 21478524 13% /
跳越者 · 2020年6月27日 14:11
rm -rf /var/www/bigmeesun.cn,然后卸载trojan,重新安装trojan和wordpress试试
test · 2020年6月26日 21:13
WordPress安装成功后,浏览器访问域名访问不了呢?
跳越者 · 2020年6月26日 21:17
提示啥?
test · 2020年6月26日 21:20
该网页无法正常运作bigmeesun.cn 未发送任何数据。
ERR_EMPTY_RESPONSE
跳越者 · 2020年6月26日 21:24
重启trojan和nginx试试
tested · 2020年6月26日 21:36
重启命令是什么呢?
跳越者 · 2020年6月26日 21:37
systemctl restart nginx trojan
tested · 2020年6月26日 22:10
重新装了一遍,又运行了systemctl restart nginx trojan
还是不行啊,
装的时候:
Error: Problems in request:
missing groups or modules: php:remi-7.4
但最后好像
Dependencies resolved.
Nothing to do.
解决了这个依赖
/dev/fd/63: line 132: cd: too many arguments
cp: cannot stat ‘wp-config-sample.php’: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
sed: can’t read wp-config.php: No such file or directory
Can’t open wp-config.php: No such file or directory.
chown: cannot access ‘/var/www/bigmeesun.cn’: No such file or directory
chown: cannot access ‘bigmeesun.cn’: No such file or directory
/dev/fd/63: line 153: /etc/nginx/conf.d/${domain}.conf: ambiguous redirect
WordPress安装成功
最后显示成功安装,是不是安装过程中有些错误给忽略了哦
跳越者 · 2020年6月26日 22:39
建议你重装系统,然后重新来过
tested · 2020年6月26日 21:38
重启了,还是那个错误呢?
tested · 2020年6月26日 21:40
https://bigmeesun.cn
是不是步骤里面少写了什么步骤呢?
wlei · 2020年6月17日 14:39
接上条,,然后刚刚试了用文章里第1种方式做静态网站,结果一路到重启的时候提示:systemctl restart nginx trojan
wlei · 2020年6月17日 14:40
提示:
Failed to restart nginx.service: Unit not found.
跳越者 · 2020年6月17日 14:41
你服务器装了宝塔?
wlei · 2020年6月17日 14:46
没有,直接重装的系统,然后就跑了一键安装trojan的脚本,其他啥也没做
跳越者 · 2020年6月17日 14:48
trojan脚本运行没问题?
wlei · 2020年6月17日 14:50
当时选项选完就让它自己跑着,等我过段时间再看已经可以用了,当时测试反代网站打不开,但是Trojan能连上就没管。今天说来搞一下静态页面,就这样了。
跳越者 · 2020年6月17日 14:51
不应该啊,trojan能用说明nginx应该正常安装了
wlei · 2020年6月17日 14:57
将 “remote_addr” 改成 “127.0.0.1”,”remote_port” 改成 8080。。。。。。这个的默认内容是啥来着?我该回去,现在Trojan不能用了。。
跳越者 · 2020年6月17日 14:58
你卸载trojan重装吧
wlei · 2020年6月17日 15:12
卸载重装完了,然后现在Trojan又可以正常用了,但是域名还是打不开反代的小说站。
跳越者 · 2020年6月17日 15:26
有可能是后端的小说站挂了,能用就好
wlei · 2020年6月17日 17:05
我去参考了其他非一键安装脚本安装的教程,单独安装了nginx,然后再按照你的教程进行配置,现在全部正常了,放的静态网页可以正常访问了。
跳越者 · 2020年6月17日 17:06
挺好的
wlei · 2020年6月17日 17:10
感谢
wlei · 2020年6月17日 14:37
用一键脚本安装后trojan测试正常使用,访问域名的时候没有正常打开反向代理的网站。
Zzzs · 2020年6月7日 22:38
我用您给的一件trojan脚本,刚看了下配置,remote addr :www.aiduxshuo.com,再看了下这篇文章的日期是比较早的,是不是就不用建个伪装的站了?
跳越者 · 2020年6月7日 22:59
默认已经代理了小说网站,如果只是科学上网,没必要再建站了
Zzzs · 2020年6月8日 13:58
好的,多谢。
十二 · 2020年6月14日 09:22
请问大佬 将你的文件上传到 /usr/share/nginx/html 文件夹 中的你的文件具体是什么
跳越者 · 2020年6月14日 09:55
比如你要上传一张照片,“你的文件”就指代那个照片
十二 · 2020年6月14日 10:57
谢谢您的解答😁,电脑没在身边请问用手机怎么找到部署的配置文件/usr/local/etc/trojan/config.json
跳越者 · 2020年6月14日 11:36
你需要下载一个ssh终端
十二 · 2020年6月14日 11:38
请问有手机版吗
跳越者 · 2020年6月14日 11:45
手机版ssh终端当然有,你搜一下呗
十二 · 2020年6月14日 12:01
好滴! 请问wordpress数据库的用户名和密码是登录哪里的?
跳越者 · 2020年6月14日 12:17
首次打开博客会让你填,其他时候都不需要
十二 · 2020年6月14日 12:49
我是说一键安装wordpress脚本以后出现的
WordPress安装成功!
===============================
WordPress安装路径:/var/www/test.tlanyan.me
WordPress数据库:wordpress
WordPress数据库用户名:wordpress
WordPress数据库密码:WtNUR6avj0sKaMl9
这里的用户名和密码在哪登录
跳越者 · 2020年6月14日 13:12
不用管,帮你填好了
十二 · 2020年6月14日 12:59
我填的不是安装完给的,是我另外填的,是不是我填错了
跳越者 · 2020年6月14日 13:13
没错,和这个问没关系
十二 · 2020年6月14日 14:21
那一键脚本给的用户名和密码是进哪用的?
67 · 2020年6月16日 11:52
wordpress一键脚本运行完,输入域名打不开
67 · 2020年6月16日 11:58
WordPress安 装 路 径 : /var/www/fxck.shenlaizhibi.to
fxck.shenlaizhibi.top
WordPress数 据 库 : wordpress
WordPress数 据 库 用 户 名 : wordpress
WordPress数 据 库 密 码 : 1003GT7CuCEiqN3i
博 客 访 问 地 址 : https://fxck.shenlaizhibi.top
fxck.shenlaizhibi.top:443
跳越者 · 2020年6月16日 12:01
trojan能正常使用吗?重启nginx和trojan试试:systemctl restart nginx; systemctl restart trojan
67 · 2020年6月16日 12:18
[email protected] ~]# systemctl rest
rt nginx
[[email protected] ~]# systemctl rest
rt trojan
[[email protected] ~]# systemctl rest
rt trojan
[[email protected] ~]# systemctl rest
rt trojan
[[email protected] ~]#
复制的不全,我用手机执行的,命令不好使啊
跳越者 · 2020年6月16日 12:27
命令没有输出
67 · 2020年6月16日 12:30
求哥哥教我怎么输出
跳越者 · 2020年6月16日 15:04
这两条命令本来就不会有输出,你要检查的是看看程序运行是不是正常
Anon · 2020年6月6日 10:43
捉虫:是hexo不是huxo.
跳越者 · 2020年6月6日 10:47
感谢反馈,确实是写错了
kpi · 2020年6月3日 22:42
老大 我想给wordpress的数据库备份 该用什么命令啊
跳越者 · 2020年6月3日 22:44
mysqldump
kik · 2020年5月12日 18:46
你好,请问一下,为什么我运行了 trojan和安装了这个博客后。在后台查看nginx的访问日志都是 127.0.0.1开头的?
跳越者 · 2020年5月12日 21:15
你可以自己配置一下格式,显示用户的真实ip
kik · 2020年5月12日 22:50
你好,这个问题已经折腾一段时间了。看了下脚本后生成的nginx配置文件。开始以为是反向代理。后来也根据网上的资料做出相关调整,但是也没有解决。本人有打算搞好博客的打算。但是访客ip这个就弄的头疼,请求支招。。
跳越者 · 2020年5月12日 22:56
你看看nginx日志的最后一个字段是不是ip?如果是,那就是真实ip,如果不是,那就trojan伪装建站就没办法获取真实ip,因为trojan转发的是tcp
跳越者 · 2020年5月12日 22:56
如果访客ip对你很重要,建议用v2伪装建站,那个是可以记录真实ip的
飞翔天仙 · 2020年4月25日 17:34
wordpress建站后进入后台管理界面就报错
ERR_TOO_MANY_REDIRECTS
请教什么原因?
跳越者 · 2020年4月25日 17:58
你的端口是443吗?
飞翔天仙 · 2020年4月25日 18:47
没错,就是https,浏览主页没问题,转到后台管理就不行了
跳越者 · 2020年4月25日 18:53
你到论坛或者tg上私聊我,我进去看看啥问题,昨天刚解决了主页加载的问题
飞翔天仙 · 2020年4月26日 16:50
老大,我在tg了可是我怎么私聊你?
跳越者 · 2020年4月26日 17:07
点我的头像,然后聊天
飞翔天仙 · 2020年4月26日 22:07
信息发不了,提示什么only send to mutual contacts…..
跳越者 · 2020年4月26日 22:09
你在群里找我一下,或者点击申述一下,应该一会jiu hao lo
飞翔天仙 · 2020年4月26日 22:15
我刚才喊了,但怎么申诉?
跳越者 · 2020年4月26日 22:16
记得好像是点提示链接,然后说没有违规行为就可以了
就是爱爬墙 · 2020年4月17日 21:03
老大,俺用毛子vps新装系统CentOS7 安装您的Trojan后再安Wordpress,浏览器输入域名后出现ERR_TOO_MANY_REDIRECTS错误,求教如何解决啊
跳越者 · 2020年4月17日 21:06
看起来是nginx的配置错了,到论坛私聊,把ngix的配置发给我看看?
ILL · 2020年4月14日 19:45
我想请教一下,我在服务端运行了wp脚本,然后浏览器输入网址,然后就是输入用户名密码邮箱都没有问题,点击安装之后他也显示我可以用用户名和密码登入网站。但是再刷新就进不去了,网站加载错误,我用手机去输入网址也进不去。外网可以正常上。这是为什么?
跳越者 · 2020年4月14日 20:41
网页提示啥?
ILL · 2020年4月14日 20:50
手机浏览器上的提示是
位于(网址)的网页无法加载,因为:
net::ERR_EMPTY_RESPONSE
跳越者 · 2020年4月14日 20:52
感觉是域名不对,电脑上试试
iLL · 2020年4月14日 22:35
不行,网页显示
当前无法使用此页面 未发送任何数据。
ERR_EMPTY_RESPONSE
而且应该不是域名不对,因为我之前是已经进入了wp的安装索引,填好了信息,点了安装之后提示成功,再刷新就不行了
跳越者 · 2020年4月14日 22:38
tail /var/log/nginx/你的域名.error.log,看看有啥日志
iLL · 2020年4月14日 22:44
我好像发现了点,我发现你写的trojan脚本和wp的脚本用的是同一个端口443,是不是因为这个原因呢?
跳越者 · 2020年4月14日 22:46
wp用的8080啊,443入口而已
iLL · 2020年4月14日 23:12
我输入了,什么都没有显示。。
跳越者 · 2020年4月14日 23:18
tail /var/log/nginx/你的域名.access.log 呢?
iLL · 2020年4月15日 12:21
127.0.0.1 – – [15/Apr/2020:08:06:19 +0800] “GET /1 HTTP/1.1” 301 5 “-” “Opera/9.80 (Windows NT 6.1; U; zh-cn) Presto/2.9.168 Version/11.50” “-”
127.0.0.1 – – [15/Apr/2020:08:06:20 +0800] “GET / HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.33 Safari/534.3 SE 2.X MetaSr 1.0” “-”
127.0.0.1 – – [15/Apr/2020:08:06:20 +0800] “GET /?& HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50” “-”
127.0.0.1 – – [15/Apr/2020:08:06:20 +0800] “GET /?& HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50” “-”
127.0.0.1 – – [15/Apr/2020:08:06:22 +0800] “GET / HTTP/1.1” 301 5 “-” “Opera/9.80 (Windows NT 6.1; U; zh-cn) Presto/2.9.168 Version/11.50” “-”
127.0.0.1 – – [15/Apr/2020:08:48:30 +0800] “GET / HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36” “-”
127.0.0.1 – – [15/Apr/2020:08:59:52 +0800] “GET / HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Linux; Android 6.0.1; Le X520 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 Mobile Safari/537.36” “-”
127.0.0.1 – – [15/Apr/2020:09:01:05 +0800] “GET / HTTP/1.1” 301 5 “http://test.illusion.monster:443/” “Mozilla/5.0 (Linux; Android 6.0.1; Le X520 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 Mobile Safari/537.36” “-”
127.0.0.1 – – [15/Apr/2020:10:57:51 +0800] “GET / HTTP/1.1” 301 5 “-” “-” “-”
127.0.0.1 – – [15/Apr/2020:12:03:08 +0800] “GET / HTTP/1.1” 301 5 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36” “-“
跳越者 · 2020年4月15日 12:39
看起来你这是重定向问题,服务端哪里还是配置错了
killer · 2020年4月14日 10:22
有办法可以使得trojan和宝塔的https共存么····
跳越者 · 2020年4月14日 10:57
先装宝塔再运行本站脚本就可以
killer · 2020年4月14日 11:53
其他进程占用了80或443端口,请先关闭再运行一键脚本
端口占用信息如下:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4997/nginx: master tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 4997/nginx: master
运行后显示这个
跳越者 · 2020年4月14日 11:54
你要建站还是安装trojan?
killer · 2020年4月14日 12:12
站已经建好,想安个trojan安不上 只能v2ray么
跳越者 · 2020年4月14日 12:13
可以triojan啊,不过v2带伪装和trojan会冲突,需要手动解决
killer · 2020年4月14日 12:18
宝塔开了强制https 装 trojan一键脚本 就不行 显示进程占用了80 443端口
跳越者 · 2020年4月14日 12:21
那可能trojan脚本没检测宝塔,忘了
大橙子 · 2020年4月8日 02:06
求站长尽快兼容BT宝塔面板
期待期待~~
跳越者 · 2020年4月8日 04:34
目前已经兼容了啊,有宝塔的可以直接用
韭菜民宿 · 2020年4月1日 12:11
怎么卸载呀,按照教程安装成功了,但是输入网址进不去,还是显示如下错误,想卸载了。
Please enable cookies.
Error 1001 Ray ID: 57cf75a7c945455e • 2020-04-01 04:10:18 UTC
DNS resolution error
What happened?
You’ve requested a page on a website (www.shuang0232.com) that is on the Cloudflare network. Cloudflare is currently unable to resolve your requested domain (www.shuang0232.com). There are two potential causes of this:
Most likely: if the owner just signed up for Cloudflare it can take a few minutes for the website’s information to be distributed to our global network.
Less likely: something is wrong with this site’s configuration. Usually this happens when accounts have been signed up with a partner organization (e.g., a hosting provider) and the provider’s DNS fails.
Cloudflare Ray ID: 57cf75a7c945455e • Your IP: 34.84.173.216 • Performance & security by Cloudflare
跳越者 · 2020年4月1日 12:21
你的dns解析或者cf配置有问题
卸载比较麻烦,你就先放着呗
韭菜民宿 · 2020年4月2日 14:13
好的,老大。没有影响就放着了~
浩 · 2020年3月31日 08:27
请问我配好wordpress后打开我的域名,排版显示很乱,白底黑字,这是什么情况
跳越者 · 2020年3月31日 09:11
有些资源美加载上
浩 · 2020年3月31日 09:37
可以重新执行脚本吗
跳越者 · 2020年3月31日 09:41
可以
浩 · 2020年3月31日 10:21
问题解决了,不知道别人有没有这个问题,我在这顺便说一下吧,我用这个WordPress一键脚本搭建好后,进主页发现无法加载全部内容,而且管理后台无法进入,我从/var/www/www.你的域名 文件夹内的wp-config.php中,第一行define前面加入
$_SERVER[‘HTTPS’] = ‘on’;
define(‘FORCE_SSL_LOGIN’, true);
define(‘FORCE_SSL_ADMIN’, true);
两个问题就都解决了
跳越者 · 2020年3月29日 19:37
你到论坛注册一下,找我私聊
呆底 · 2020年3月29日 18:46
大神,客户端WordPress安装成功后输出了安装路径、数据库、数据库用户名密码、博客访问地址,我把博客访问地址粘贴到浏览器显示下面内容,怎么办?
500 Internal Privoxy Error
Privoxy encountered an error while processing your request:
Could not load template file no-server-data or one of its included components.
Please contact your proxy administrator.
If you are the proxy administrator, please put the required file(s)in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It’s typically the Privoxy install directory).
跳越者 · 2020年3月29日 18:50
你的代理配置错误或者用不了,关了代理再打开
呆底 · 2020年3月29日 19:30
还是不行,用的谷歌云,刚刚去后台把vps关了重启,还是一样,上youtube等外网是没问题,就是访问域名的网站就显示500那个。
跳越者 · 2020年3月29日 19:31
你把代理关了,直接访问博客,出现啥?
呆底 · 2020年3月29日 19:36
显示这个
该网页无法正常运作
http://www.ladyman520.xyz 未发送任何数据。
ERR_EMPTY_RESPONSE
testdd · 2020年6月26日 21:18
一样的错误
做站VPS推荐 - V2ray科技 · 2021年3月12日 20:20
[…] V2ray伪装建站教程 和 trojan建站教程 […]