vsp新机装系统

change ssh port from 22 to xxxx,不能改太大,我试了改5位数连不上
防止大量攻击的第一步

2. 分区
发现刚装好只用了4G,其余分区未挂载。用到的命令
vgs
pvs
lvs
vgdisplay

lvcreate -L 5G -n lvwww ubuntu-vg
lvcreate -L 5G -n lvopt ubuntu-vg
lvcreate -l 1279 -n lvusr ubuntu-vgmkfs.ext4 /dev/ubuntu-vg/lvopt
mkfs.ext4 /dev/ubuntu-vg/lvwww
mkfs.ext4 /dev/ubuntu-vg/lvusrmount /dev/ubuntu-vg/lvopt /opt
mount /dev/ubuntu-vg/lvwww /var/www
mount /dev/ubuntu-vg/lvusr /usr/local

在/etc/fstab中加入
/dev/ubuntu-vg/lvopt /opt ext4 defaults 0 0
/dev/ubuntu-vg/lvwww /var/www ext4 defaults 0 0
/dev/ubuntu-vg/lvusr /usr/local ext4 defaults 0 0

3. 安装mysql
系统是ubuntu20.0LTS,之前用apt-get install,自动把mysql8.0装上了,还一大堆错误,即使解决了错误,很耗内存,十分不好用,强烈建议手动安装成mysql5.7

到mysql官网下载deb包:
https://repo.mysql.com/apt/ubuntu/pool/mysql-5.7/m/mysql-community/mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
mysql-client_5.7.29-1ubuntu18.04_amd64.deb
mysql-common_5.7.29-1ubuntu18.04_amd64.deb
mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb

用dpkg强制安装。中间会告诉你还依赖了2个lib
用这个把lib装上就好用了
apt –fix-broken install

4. 安装apache2
这个走正常apt-get install即可,配置默认也还好

5. 其他可能需要的命令
netstat -ltnp
ps aux –sort=%mem
free -m

进mysql
mysql -uroot -pPASSWORD

导入数据库
mysql -uroot -pPASSWORD DATABASENAME < backup.sql

6. ftp服务

参考:https://blog.csdn.net/gybshen/article/details/79782884

配置文件:
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd_userlist
allow_writeable_chroot=YES

systemctl restart vsftpd.service

/etc/vsftpd.chroot_list
systemctl restart vsftpd

7. vpn ssr
参考:https://wenziju.com/index.php/archives/331/

8. DNS
vi /etc/systemd/resolved.conf

设置DNS=8.8.8.8
systemctl restart systemd-resolved.service

9. 查看网络监听情况
netstat -anpl

10. bbr加速(未验证)
echo ‘net.core.default_qdisc=fq’ >> /etc/sysctl.conf
echo ‘net.ipv4.tcp_congestion_control=bbr’ >> /etc/sysctl.conf
sysctl -p