bash <(curl -sL https://raw.githubusercontent.com/daveleung/hijkpw-scripts-mod/main/v2ray_mod1.sh)
bash <(curl -sL https://raw.githubusercontent.com/Miuzarte/hijk.sh/main/Original/wordpress.sh)
vim test.sh
# 安装opcache模块,加快代码执行
yum install -y php-opcache
sed -i 's/;opcache.revalidate_freq=2/opcache.revalidate_freq=30/' /etc/php.d/10-opcache.ini
# 上传文件最大默认是2M,改为200M,可以改成其他值
line=`grep -n access_log /etc/nginx/nginx.conf | cut -d: -f1`
line=`expr ${line} + 1`
res=`grep client_max_body_size /etc/nginx/nginx.conf`
[ "$res" = "" ] && sed -i "${line}a client_max_body_size 200m;" /etc/nginx/nginx.conf
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 200M/' /etc/php.ini
sed -i 's/post_max_size = 8M/post_max_size = 200M/' /etc/php.ini
# 优化Nginx设置
res=`grep gzip /etc/nginx/nginx.conf`
[ "$res" = "" ] && sed -i "${line}a gzip on;" /etc/nginx/nginx.conf
# Nginx安全设置
res=`grep server_tokens /etc/nginx/nginx.conf`
[ "$res" = "" ] && sed -i "${line}a server_tokens off;" /etc/nginx/nginx.conf
res=`grep SAMEORIGIN /etc/nginx/nginx.conf`
[ "$res" = "" ] && sed -i "${line}a add_header X-Frame-Options SAMEORIGIN;" /etc/nginx/nginx.conf
res=`grep nosniff /etc/nginx/nginx.conf`
[ "$res" = "" ] && sed -i "${line}a add_header X-Content-Type-Options nosniff;" /etc/nginx/nginx.conf
res=`grep Protection /etc/nginx/nginx.conf`
[ "$res" = "" ] && sed -i "${line}a add_header X-XSS-Protection \"1; mode=block\";" /etc/nginx/nginx.conf
# 重新加载配置
systemctl restart php-fpm nginx
chmod +x test.sh
./test.sh DRopbox: weimx2015@gmail.com 备份:UpdraftPlus