alpinelinux安装并使用XRay

alpinelinux

系统资源占用少

安装

1
2
3
wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh
bash InstallNET.sh -alpine
reboot

ssh的登陆信息:

1
2
3
ssh 端口:22
用户名:root
密码:LeitboGi0ro

/etc/ssh/sshd_config中修改

1
2
3
Port *
PermitRootLogin yes
PasswordAuthentication yes

修改密码passwd root

开启BBR3

1
2
3
4
5
6
7
cat > /etc/sysctl.conf << EOF

net.core.default_qdisc=fq_pie

net.ipv4.tcp_congestion_control=bbr

EOF

更新alpinelinux来源

更新alpinelinux

1
2
3
4
5
6
7
8
# 查看当前版本
cat /etc/alpine-release
# 修改镜像源
setup-apkrepos
(清华镜像源)[https://mirrors.tuna.tsinghua.edu.cn/help/alpine/]
apk update
apk add --upgrade apk-tools
apk upgrade --available

安装xray来源

安装xray

更新xray

Xray-install for Alpine Linux

English | 简体中文 | 繁體中文

安装 Xray

安装 cURL

1
apk add curl

下载安装脚本

1
curl -O -L https://github.com/XTLS/Xray-install/raw/main/alpinelinux/install-release.sh

运行安装脚本

1
ash install-release.sh

管理命令

启用 Xray 服务 (开机自启)

1
rc-update add xray

禁用 Xray 服务 (取消自启)

1
rc-update del xray

运行 Xray

1
rc-service xray start

停止 Xray

1
rc-service xray stop

重启 Xray

1
rc-service xray restart

xray默认的的log路径

/var/log/xray/access.log
/var/log/xray/error.log