# 开启网络BBR模块 echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf echo "net.ipv4. tcp_congestion_control=bbr" >> /etc/sysctl.conf sysctl -p # 打开连接数限制 echo "* hard nofile 64000" >> /etc/security/limits.conf echo "* soft nofile 64000" >> /etc/security/limits.conf echo "root hard nofile 64000" >> /etc/security/limits.conf echo "root soft nofile 64000" >> /etc/security/limits.conf # 配置vimrc cat >> ~/. vimrc <<EOF set autoindent set nobackup set tabstop=2 set shiftwidth=2 set softtabstop=2 set expandtab set number set ruler set nocompatible set syntax=on set noeb EOF # 系统更新 dnf update -y dnf install -y wget curl zip unzip vim mailx mlocate telnet bash-completion dnf install -y epel-release dnf install -y htop tree lrzsz unzip dnf install -y device-mapper-persistent-data lvm2 psmisc net-tools dnf install -y mysql unzip mlocate dnf install -y bind-utils python3-dnf-plugin-versionlock dnf remove -y podman* updatedb # 配置防火墙 systemctl enable --now firewalld.service firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-prot={8010/tcp, 8080/tcp} firewall-cmd --reload
MySQL
# 这里使用阿里的RDS,需要在阿里云上配置RDS的版本、数据库、访问用户和访问白名单 # 导出数据库 [root@sites]mysqldump --skip-lock-tables -uexample -p db_example >~/mysql.sql # 将原有数据库导入RDS [root@Web ~]# mysql -uexample -hrm-example.mysql.rds.aliyuncs.com -p Enter password: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | db_example | | mysql | +--------------------+ 3 rows in set ( 0. 00 sec ) mysql> use db_examples; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> source /root/mysql.sql;
中间件环境
Httpd
# 安装Apache dnf install -y httpd # 修改模块配置,让Apache运行在8080端口 sed -i 's/#LoadModule mpm_prefork_module/LoadModule mpm_prefork_module/g' /etc/httpd/conf.modules.d/00-mpm.conf sed -i 's/LoadModule mpm_event_module/#LoadModule mpm_event_module/g' /etc/httpd/conf.modules.d/00-mpm.conf sed -i 's/#LoadModule heartmonitor_module/LoadModule heartmonitor_module/g' /etc/httpd/conf.modules.d/00-optional.conf sed -i 's/LoadModule/#LoadModule/g' /etc/httpd/conf.modules.d/10-proxy_h2. conf sed -i 's/LoadModule/#LoadModule/g' /etc/httpd/conf.modules.d/10-h2. conf sed -i 's/80/8080/g' /etc/httpd/conf/httpd.conf sed -i 's/index.html/index.php/g' /etc/httpd/conf/httpd.conf