主机推荐vultr https://www.vultr.com/promo25b?ref=7117962 选择特殊区域主机,每月仅需2.5刀。性能也足够 购买主机后: yum update 没有yim: yum -y install vim-enhanced 防火墙: https://www.cnblogs.com/llife/archive/2019/10/17/11695912.html firewall-cmd --permanent --add-port=端口值/tcp firewall-cmd --permanent --remove-port=端口值/tcp firewall-cmd --reload 开启BBR https://www.set-fire.com/topic/257/centos7-%E5%BC%80%E5%90%AF-tcp-bbr-%E7%9A%84%E6%96%B9%E5%BC%8F/2 其中注意不能reboot。从控制台重启 SSH配置 http://www.aiezu.com/system/linux/xshell_ssh_public-key_login.html java环境配置 https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora JRE即可 python shadowsock(不使用) 参考https://pip.pypa.io/en/latest/installing/ 参考https://pypi.python.org/pypi/shadowsocks 启动:sudo ssserver -p 端口值 -k 密码 -m aes-256-cfb -d start 停止:sudo ssserver -d stop 日志:sudo less /var/log/shadowsocks.log 一键安装shadowsock-liev(使用) https://github.com/iMeiji/shadowsocks_install/wiki/shadowsocks-libev 一键安装 安装tomcat wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.28/bin/apache-tomcat-8.5.28.tar.gz(下载) mkdir tomcat8.5(创建目录) sudo tar -zxvf apache-tomcat-8.5.28.tar.gz -C /root/tomcat8.5 --strip-components=1(解压) 启动:/root/tomcat8.5/bin/startup.sh 停止:/root/tomcat8.5/bin/shutdown.sh 注意:修改tomcat的conf/server.xml(里面的编码问题) 安装nginx1.10.3 rpm -ivh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.3-1.el7.ngx.x86_64.rpm(安装) 网站文件存放默认目录:/usr/share/nginx/html 网站默认站点配置:/etc/nginx/conf.d/default.conf 自定义Nginx站点配置文件存放目录:/etc/nginx/conf.d/(在这个文件夹下配置监听) Nginx全局配置:/etc/nginx/nginx.conf 启动:service nginx start 停止:service nginx stop 安装数据库mariadb(默认外网连接端口是3306) 参考:https://www.linuxidc.com/Linux/2016-03/128880.htm yum -y install mariadb mariadb-server systemctl start mariadb #启动服务 systemctl enable mariadb #设置开机启动 systemctl restart mariadb #重新启动 systemctl stop mariadb #停止MariaDB 设置密码: ①mysql_secure_installation ②Enter current password for root (enter for none):<–初次运行直接回车 ③Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车 New password: <– 设置root用户的密码 Re-enter new password: <– 再输入一次你设置的密码 后面选项自己决定 设置utf-8编码(参考上面地址) mysql -u 用户 -p (登陆) 创建用户及授权: create user xxxx@localhost identified by 'xxxx'; grant all on xxxx.xxxx to xxxx@localhost identified by 'xxxx'; grant all privileges on xxxx.xxxx to xxxx@'%' identified by 'xxxx'; 内存不足,新增swap分区 参考https://tieba.baidu.com/p/5353969710 fail2ban(不用了) 参考https://linux.cn/article-5067-1.html service fail2ban restart