Jump to content
PayMap
  • Tools

X-ui:支持多协议多用户的 xray 面板


Turkeymap

116 views

前言
sprov 这位大神开发的这套面板程序,很是方便,可以可视化的搭建SS、V2ray、Xray、Trojan等热门的协议,并且可以实时看到 VPS 的性能状态以及流量的使用情况。

那在经过将近两年的不断更新之后,V2-ui面板,迎来了一个比较大的转折——停止更新了。

sprov 大神又用 GO 语言重新开发了一套面板 X-UI。那这套面板相比原来的 V2-ui,兼容性更强,也便于维护, GO 语言的性能更好,而且内存占用也会相对的低一些。

功能介绍

  • 系统状态监控
  • 支持多用户多协议,网页可视化操作
  • 支持的协议:vmess、vless、trojan、shadowsocks、dokodemo-door、socks、http
  • 支持配置更多传输配置
  • 流量统计,限制流量,限制到期时间
  • 可自定义 xray 配置模板
  • 支持 https 访问面板(自备域名 + ssl 证书)
  • 更多高级配置项,详见面板

安装&升级

手动安装&升级
首先从 https://github.com/vaxilu/x-ui/releases 下载最新的压缩包,一般选择amd64架构
然后将这个压缩包上传到服务器的/root/目录下,并使用root用户登录服务器
如果你的服务器 cpu 架构不是amd64,自行将命令中的amd64替换为其他架构

cd /root/
rm x-ui/ /usr/local/x-ui/ /usr/bin/x-ui -rf
tar zxvf x-ui-linux-amd64.tar.gz
chmod +x x-ui/x-ui x-ui/bin/xray-linux-* x-ui/x-ui.sh
cp x-ui/x-ui.sh /usr/bin/x-ui
cp -f x-ui/x-ui.service /etc/systemd/system/
mv x-ui/ /usr/local/
systemctl daemon-reload
systemctl enable x-ui
systemctl restart x-ui

使用docker安装
此 docker 教程与 docker 镜像由Chasing66提供

安装docker

curl -fsSL https://get.docker.com | sh

安装x-ui

mkdir x-ui && cd x-ui
docker run -itd --network=host \
-v $PWD/db/:/etc/x-ui/ \
-v $PWD/cert/:/root/cert/ \
--name x-ui --restart=unless-stopped \
enwaiax/x-ui:latest

Build 自己的镜像

docker build -t x-ui .

建议系统

  • CentOS 7+
  • Ubuntu 16+
  • Debian 8+
     
                                                  **常见问题**

从 v2-ui 迁移
首先在安装了 v2-ui 的服务器上安装最新版 x-ui,然后使用以下命令进行迁移,将迁移本机 v2-ui 的所有 inbound 账号数据至 x-ui,面板设置和用户名密码不会迁移

迁移成功后请关闭 v2-ui并且重启 x-ui,否则 v2-ui 的 inbound 会与 x-ui 的 inbound 会产生端口冲突

x-ui v2-ui

申请 SSL 证书
下面环境的安装方式,大家根据自己的系统选择命令安装就好了。
更新及安装组件

  1. apt update -y # Debian/Ubuntu 命令

  2. apt install -y curl #Debian/Ubuntu 命令

  3. apt install -y socat #Debian/Ubuntu 命令

  4. yum update -y #CentOS 命令

  5. yum install -y curl #CentOS 命令

  6. yum install -y socat #CentOS 命令

安装 Acme 脚本

  1. curl https://get.acme.sh | sh

80 端口空闲的证书申请方式
自行更换代码中的域名、邮箱为你解析的域名及邮箱

  1. ~/.acme.sh/acme.sh --register-account -m xxxx@xxxx.com
  2. ~/.acme.sh/acme.sh --issue -d mydomain.com --standalone

安装证书到指定文件夹
自行更换代码中的域名为你解析的域名

  1. ~/.acme.sh/acme.sh --installcert -d mydomain.com --key-file /root/private.key --fullchain-file /root/cert.crt

安装证书(第二个手动方案)

1、解析域名,A-acme证书申请
A-acme证书申请:(证书安装必须在nginx之前,不然nginx会占用80端口,懂得关闭nginx的可以无视)

apt-get install -y openssl cron socat curl unzip vim

下面这个申请代码已经更新,email=后面这里要输入你的一个邮箱要输入一个邮箱,否则会报错

curl https://get.acme.sh | sh -s email=my@example.com

source ~/.bashrc

.acme.sh/acme.sh --issue -d 你的域名 --standalone -k ec-256

.acme.sh/acme.sh --installcert -d 你的域名 --fullchainpath /etc/ssl/private/你的域名.crt --keypath /etc/ssl/private/你的域名.key --ecc

chmod 755 /etc/ssl/private
#(记得cret和key要有755的权限,没有就手动添加,不然启动xray会报错23)

acme.sh --upgrade --auto-upgrade

设置证书自动签

vi /etc/ssl/private/xray-cert-renew.sh

里面填入以下内容,注意修改中文注释的地方

#!/bin/bash

.acme.sh/acme.sh --install-cert -d a-你的域名 --ecc --fullchain-file /etc/ssl/private/你的域名.crt --key-file /etc/ssl/private/你的域名.key
echo "Xray Certificates Renewed"

 

chmod +r /etc/ssl/private/你的域名.key
echo "Read Permission Granted for Private Key"

sudo systemctl restart xray
echo "Xray Restarted"

保存后加权限

chmod +x /etc/ssl/private/xray-cert-renew.sh

设置自动任务

crontab -e

在里面输入以下代码,意思为每月1日自动申请证书

0 1 1 * * bash /etc/ssl/private/xray-cert-renew.sh

原文转载自:https://www.vjsun.com/729.html

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Registration Terms & Conditions