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

    1. # 安装opcache模块,加快代码执行
    2. yum install -y php-opcache
    3. sed -i 's/;opcache.revalidate_freq=2/opcache.revalidate_freq=30/' /etc/php.d/10-opcache.ini
    4. # 上传文件最大默认是2M,改为200M,可以改成其他值
    5. line=`grep -n access_log /etc/nginx/nginx.conf | cut -d: -f1`
    6. line=`expr ${line} + 1`
    7. res=`grep client_max_body_size /etc/nginx/nginx.conf`
    8. [ "$res" = "" ] && sed -i "${line}a client_max_body_size 200m;" /etc/nginx/nginx.conf
    9. sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 200M/' /etc/php.ini
    10. sed -i 's/post_max_size = 8M/post_max_size = 200M/' /etc/php.ini
    11. # 优化Nginx设置
    12. res=`grep gzip /etc/nginx/nginx.conf`
    13. [ "$res" = "" ] && sed -i "${line}a gzip on;" /etc/nginx/nginx.conf
    14. # Nginx安全设置
    15. res=`grep server_tokens /etc/nginx/nginx.conf`
    16. [ "$res" = "" ] && sed -i "${line}a server_tokens off;" /etc/nginx/nginx.conf
    17. res=`grep SAMEORIGIN /etc/nginx/nginx.conf`
    18. [ "$res" = "" ] && sed -i "${line}a add_header X-Frame-Options SAMEORIGIN;" /etc/nginx/nginx.conf
    19. res=`grep nosniff /etc/nginx/nginx.conf`
    20. [ "$res" = "" ] && sed -i "${line}a add_header X-Content-Type-Options nosniff;" /etc/nginx/nginx.conf
    21. res=`grep Protection /etc/nginx/nginx.conf`
    22. [ "$res" = "" ] && sed -i "${line}a add_header X-XSS-Protection \"1; mode=block\";" /etc/nginx/nginx.conf
    23. # 重新加载配置
    24. systemctl restart php-fpm nginx

    chmod +x test.sh

    ./test.sh DRopbox: weimx2015@gmail.com 备份:UpdraftPlus