VPS 搭建记录

2020/8/8

记录一下个人 VPS 搭建的过程,包括 NPS、aria2、LNMP

VPS 使用 Ubuntu 20.04

# ssh 配置

修改 ssh 默认端口并保持 tcp 连接,在 /etc/ssh/sshd_config 中修改下列选项

Port ****

TCPKeepAlive yes
ClientAliveInterval 10
ClientAliveCountMax 3

AuthorizedKeysFile     .ssh/authorized_keys
AuthorizedPrincipalsFile none
AuthorizedKeysCommand none
AuthorizedKeysCommandUser nobody
1
2
3
4
5
6
7
8
9
10

重启 ssh 服务即可

systemctl restart sshd
1

# 开启 bbr

bbr 是 Google 推出的一套拥塞控制算法,集成在新的 Linux 内核中。

# 添加设置
echo net.core.default_qdisc=fq >> /etc/sysctl.conf
echo net.ipv4.tcp_congestion_control=bbr >> /etc/sysctl.conf

# 保存并启用
sysctl -p
1
2
3
4
5
6

检查运行是否正常

***@***:~# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic bbr
# 或者
***@***:~# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic bbrp bbr
1
2
3
4
5

lsmod | grep bbr 有结果存在则成功

# 安装 LNMP 环境

利用 一键安装包 (opens new window)

wget http://soft.vpser.net/lnmp/lnmp1.7.tar.gz -cO lnmp1.7.tar.gz && tar zxf lnmp1.7.tar.gz && cd lnmp1.7 && ./install.sh lnmp
1

根据提示即可

# nps 搭建

nps 用于内网穿透

GitHub 发布页 (opens new window) 下载最新 server 版本解压

./nps install
1

即可

# zFile

apt install -y openjdk-8-jre-headless unzip
wget https://c.jun6.net/ZFILE/zfile-release.war
mkdir zfile && unzip zfile-release.war -d zfile && rm -rf zfile-release.war
chmod +x zfile/bin/*.sh
1
2
3
4

# 新建用户

adduser ***
1

随后添加管理员权限

usermod -aG sudo *username*
1
Last Updated: 2023-10-29T08:26:04.000Z