trojan建站教程

trojan是基于https协议的工具,而https又是目前网站的主流协议,因此搭建好trojan后顺便整一个网站是完全没问题的,也能让trojan更安全,ip更不容易被墙。 本教程介绍trojan建站的详细过程。

首先,建议网站的主机名用 www 或者 @,即网站是通过 https://www.abc.com 或者 https://abc.com 这样的形式访问。当然blog、app等主机名也是很好的,访问形式就是 https://blog.abc.com、https://app.abc.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://raw.githubusercontent.com/luciferkids/hijkpw-scripts/main/wordpress_trojan.sh)

脚本运行后会询问你是否继续,按回车键继续,接着脚本会自动运行并配置Nginx。运行成功后输出类似如下的配置信息:

WordPress安装成功
WordPress安装成功

接下来,浏览器打开域名,进入WordPress的配置界面:

wordpress配置界面

wordpress配置界面

填好必要的信息,点击下方的“安装WordPress”,恭喜你,属于你的博客就搭建好了!接下来尽情折腾博客,开始你的写文章之旅吧!

如果打算认真写博客且长期使用,建议参考:WordPress插件推荐及性能优化建议

其他

1. 运行wordpress脚本后,trojan也能正常使用,不会受到影响。

《trojan建站教程》上有4条评论

  1. 您好,
    php服务安装失败,试过多次卸载重装,还是不行。
    安装php时执行apt update之后,显示:
    Ign:1 https://packages.sury.org/php bionic InRelease
    Err:2 https://packages.sury.org/php bionic Release
    404 Not Found [IP: 104.21.18.148 443]
    Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease
    Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
    Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
    Hit:6 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
    Reading package lists… Done
    E: The repository ‘https://packages.sury.org/php bionic Release’ does not have a Release file.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    我尝试了直接使用https://packages.sury.org/php/README.txt中的几个命令:
    ${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl
    ${SUDO} wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
    ${SUDO} sh -c ‘echo “deb https://packages.sury.org/php/ $(lsb_release -sc) main” > /etc/apt/sources.list.d/php.list’
    ${SUDO} apt-get update
    结果还是类似:
    Ign:1 https://packages.sury.org/php bionic InRelease
    Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
    Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease
    Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
    Hit:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
    Err:6 https://packages.sury.org/php bionic Release
    404 Not Found [IP: 172.67.182.150 443]
    Reading package lists… Done
    E: The repository ‘https://packages.sury.org/php bionic Release’ does not have a Release file.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/php.list:1 and /etc/apt/sources.list.d/php7.list:1
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/php.list:1 and /etc/apt/sources.list.d/php7.list:1
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/php.list:1 and /etc/apt/sources.list.d/php7.list:1
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/php.list:1 and /etc/apt/sources.list.d/php7.list:1
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/php.list:1 and /etc/apt/sources.list.d/php7.list:1
    请问您有什么解决方案么?谢谢。

  2. 您好,
    ubuntu安装php7.4似乎不能用脚本里的方式,需要使用:
    add-apt-repository ppa:ondrej/php

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注