本文最后更新于 89 天前,其中的信息可能已经有所发展或是发生改变。
以debian、ubuntu系统为主,注明centos的为centos命令,代码中形如[p#1 域名]的为参数,需要修改后方可使用,建议使用SSH客户端为finalshell,便于输入多行命令,修改参数等操作。
1、获取管理员权限
sudo -i
2、更新系统组件
apt update -y && apt install -y curl
3、更新系统组件(centos)
yum update -y && yum update -y
4、warp
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh
5、安装hysteria2
wget -N --no-check-certificate https://raw.githubusercontent.com/Misaka-blog/hysteria-install/main/hy2/hysteria.sh && bash hysteria.sh
6、安装wireguard
curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
./wireguard-install.sh
7、安装 x-ui
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
8、dd系统
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -[p#1 (d/u)] [p#2 (10/20.04)] -v 64 -p [p#3 密码] -port 22
9、宝塔破解版
wget -O install.sh http://v7.hostcli.com/install/install-ubuntu_6.0.sh &&bash install.sh
10、woiden服务器解除80端口占用
service apache2 stop
systemctl disable apache2
11、bbr(KVM)
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
12、bbr(LXC,OVZ)
wget --no-cache -O lkl-haproxy.sh https://github.com/mzz2017/lkl-haproxy/raw/master/lkl-haproxy.sh && bash lkl-haproxy.sh
13、杀死进程
kill -9 [p#1 进程号]
14、查看VPS已开放端口
netstat -aptn
15、服务器测试
bash <(curl -sSL 'https://dxt.pages.dev')
16、申请acme证书(ipv4)
# 安装依赖
apt install -y socat curl cron
# 安装 acme.sh
curl https://get.acme.sh | sh
# 刷新环境变量
source ~/.bashrc
# 注册账户
~/.acme.sh/acme.sh --register-account \
-m [email protected]
# 停止 nginx,释放80端口
systemctl stop nginx
# 申请证书
~/.acme.sh/acme.sh --issue \
-d [p#1域名] \
--standalone
# 创建证书目录
mkdir -p /root/cert
# 安装证书
~/.acme.sh/acme.sh --install-cert \
-d [p#1域名] \
--key-file /root/cert/private.key \
--fullchain-file /root/cert/cert.crt \
--reloadcmd "systemctl restart nginx"
# 启动 nginx
systemctl start nginx
或者
# 安装依赖
apt install -y socat curl cron
# 安装 acme.sh
curl https://get.acme.sh | sh
# 刷新环境变量
source ~/.bashrc
# 注册 ZeroSSL 账户
~/.acme.sh/acme.sh --register-account \
-m [email protected] \
--server zerossl
# 如果 nginx 占用了 80 端口,先关闭
systemctl stop nginx
# 申请证书
~/.acme.sh/acme.sh --issue \
-d [p#1 域名] \
--standalone \
--server zerossl \
--keylength ec-256
# 创建证书目录
mkdir -p /root/cert
# 安装证书
~/.acme.sh/acme.sh --install-cert \
-d [p#1 域名] \
--ecc \
--key-file /root/cert/private.key \
--fullchain-file /root/cert/cert.crt \
--reloadcmd "systemctl restart nginx"
# 启动 nginx
systemctl start nginx
17、申请acme证书(ipv6)
# 安装依赖
apt install -y socat curl cron
# 安装 acme.sh
curl https://get.acme.sh | sh
# 刷新环境变量
source ~/.bashrc
# 注册账户
~/.acme.sh/acme.sh --register-account \
-m [email protected]
# 如果 nginx 占用80端口,先停止
systemctl stop nginx
# 申请证书
~/.acme.sh/acme.sh --issue \
-d [p#1域名] \
--standalone \
-k ec-256 \
--listen-v6
# 创建证书目录
mkdir -p /root/cert
# 安装证书
~/.acme.sh/acme.sh --install-cert \
-d [p#1域名] \
--ecc \
--key-file /root/cert/private.key \
--fullchain-file /root/cert/cert.crt \
--reloadcmd "systemctl restart nginx"
# 启动 nginx
systemctl start nginx 2>/dev/null
或者
# 安装依赖
apt install -y socat curl cron
# 安装 acme.sh
curl https://get.acme.sh | sh
# 刷新环境变量
source ~/.bashrc
# 注册 ZeroSSL 账户
~/.acme.sh/acme.sh --register-account \
-m [email protected] \
--server zerossl
# 如果 nginx 占用80端口,先停止
systemctl stop nginx
# 申请证书
~/.acme.sh/acme.sh --issue \
-d [你的域名] \
--standalone \
--server zerossl \
-k ec-256 \
--listen-v6
# 创建证书目录
mkdir -p /root/cert
# 安装证书
~/.acme.sh/acme.sh --install-cert \
-d [你的域名] \
--ecc \
--key-file /root/cert/private.key \
--fullchain-file /root/cert/cert.crt \
--reloadcmd "systemctl restart nginx"
# 启动 nginx
systemctl start nginx
18、开放所有端口
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
19、warp-go
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/warp-go.sh && bash warp-go.sh
20、nezha探针监控Serv00
wget -O 1kejiV01.sh "https://pan.1keji.net/f/ERGcp/1kejiV01.sh" && chmod +x 1kejiV01.sh && ./1kejiV01.sh
21、Alpine系统安装hysteria2
wget -O hy2.sh https://raw.githubusercontent.com/zrlhk/alpine-hysteria2/main/hy2.sh && sh hy2.sh
22、宝塔面板清空回收站
rm -rf /.Recycle_bin/*
23、安装Watchtower
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--interval 3600 \
--cleanup