SatelliteWP / rocket-nginx

Rocket-Nginx is a Nginx configuration that makes WP-Rocket even faster by serving static pages directly without loading WordPress or PHP.
MIT License
579 stars 129 forks source link

Conflict with Wordfence? - The nginx/rocket-nginx/conf.d folder was not being created. - NGINX - php.ini - auto_prepend_file = '/usr/share/nginx/html/www/wordfence-waf.php' #211

Closed jimgarrigan closed 4 months ago

jimgarrigan commented 4 months ago

Observation: The nginx/rocket-nginx/conf.d folder was not being created.

After a lot of trial and error, I determined that a value in the php.ini file was causing the problem.

After I deleted the value '/usr/share/nginx/html/www/wordfence-waf.php' from the setting auto_prepend_file in the php.ini file, the nginx/rocket-nginx/conf.d folder, the nginx/rocket-nginx/conf.d/default folder, and the file nginx/rocket-nginx/conf.d/default.conf were created.

php.in file: auto_prepend_file = '/usr/share/nginx/html/www/wordfence-waf.php'

I am still building my staging environment. Other issues may exist. This is not my area of expertise,

Versions What version of Nginx are you using? nginx version: nginx/1.25.4 What version of Rocket-Nginx are you using? Version: 3.0.2 What version of WP Rocket are you using? Version 3.15.9 PHP 8.2.9 (cli) (built: Aug 24 2023 20:33:12) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.9, Copyright (c) Zend Technologies with Zend OPcache v8.2.9, Copyright (c), by Zend Technologies Are you using Nginx as a reverse proxy (with Apache for instance)? No

I did not see any errors with debug activated.

For testing I used the, "nginx-config-kit-for-wordpress-1.3". From the respective readme file: This config kit contains the Nginx configurations used in the Install WordPress on Ubuntu 18.04 guide. It contains best practices from various sources, including the WordPress Codex and H5BP.

Jim Garrigan Subject matter: Automation via PowerShell | Active Directory | Windows Server www.garrigan.nyc 15th March 2024

maximejobin commented 4 months ago

If the folder was never created, you simply can't add the Rocket-Nginx configuration. It is not created automatically. You have to follow the installation steps.

Therefore, Rocket-Nginx is not activated or used.

The problem has nothing to do with Rocket-Nginx.

jimgarrigan commented 3 months ago

My intention is to share information with others.

After I deleted the value '/usr/share/nginx/html/www/wordfence-waf.php' from the setting auto_prepend_file in the php.ini file, the nginx/rocket-nginx/conf.d folder, the nginx/rocket-nginx/conf.d/default folder, and the file nginx/rocket-nginx/conf.d/default.conf were created.

To be more exact, I followed the steps listed below and those steps created the rocket-nginx directory structure ...

rocket-nginx rocket-nginx/.git rocket-nginx/.github rocket-nginx/conf.d rocket-nginx/conf.d/default rocket-nginx/conf.d/default.conf rocket-nginx/tests

For the sake of brevity, I did not list all subdirectories and files.

List of steps: yum install git -y cd /etc/nginx git clone https://github.com/satellitewp/rocket-nginx.git cd rocket-nginx cp rocket-nginx.ini.disabled rocket-nginx.ini I changed the permissions of the rocket-nginx directory to match the php-fpm user. php rocket-parser.php