• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Plesk 12.0.18 for Linux / CentOS 6 Problem with Use 'LogLevel debug' to get a backtrace

I am currently running a WordPress Multisite installation with a number of websites active. I have started getting large volumes of the following error message in my error log:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I have so far from a lot of trial and error been unable to identify what action is triggering these errors, i.e. I can't see to make them happen.

I used this - http://kb.odin.com/en/120101 - to attempt to enable 'LogLevel debug' as per the error messages, however, this seems to have produced no further detail in the error log, and upon inspection of the log stored here - /usr/local/psa/admin/logs/panel.log - I cannot see any reference to this error, or indeed any entries with corresponding date/time stamps to the entries in the error log.

Can someone please advise:
1. Have I taken the correct action to enable 'LogLevel debug'?
2. Am I looking in the correct place for the additional error information?
3. Any other advice on how I can begin to investigate the cause of this error?
 
Hi Dominic Vermeulen-Smith,

I have started getting large volumes of the following error message in my error log:
Did you get these errors from your panel.log, or from domain specific logs, or in any other log?

I used this - http://kb.odin.com/en/120101 - to attempt to enable 'LogLevel debug' as per the error messages, however, this seems to have produced no further detail in the error log, and upon inspection of the log stored here - /usr/local/psa/admin/logs/panel.log - I cannot see any reference to this error, or indeed any entries with corresponding date/time stamps to the entries in the error log.
Please be aware, that the suggestions from the KB - article only change the log - level for your Plesk Control Panel - logs and not for any domain - specifc domain. If you would like to raise the log - level for specific domains, please insert

For apache:

LogLevel debug

... in your additional webserver directives at "Websites & Domains > <domain_name> > Web Server Settings".
Your domain specific log - files are located at: "/var/www/vhosts/system/example.com/logs/*"


Can you confirm, that you followed the official guideline for your ".htaccess" file for multisites? ( Reference: http://codex.wordpress.org/Create_A_Network )

tools-network-created.png



Can you as well confirm, that you created additional nginx - rewrite rules, if you use nginx as well, according to your ".htaccess" - file? ( nginx ignores ".htaccess" - files, so you have to convert them for nginx.


Please consider to list your plugins for further investigations and please add additional informations to your webserver usage ( apache, apache+nginx, apache+nginx+php5-fpm ?!? ).
 
Hi

Did you get these errors from your panel.log, or from domain specific logs, or in any other log?

- I can confirm that the original errors I identified are in the domain specific error logs rather than panel.log, perhaps I've got the two mixed up here.

Please be aware, that the suggestions from the KB - article only change the log - level for your Plesk Control Panel - logs and not for any domain

- OK thanks.

If you would like to raise the log - level for specific domains, please insert

For apache:

LogLevel debug

... in your additional webserver directives at "Websites & Domains > <domain_name> > Web Server Settings".
Your domain specific log - files are located at: "/var/www/vhosts/system/example.com/logs/*"

- Can you please confirm exactly what to enter here? I have tried to enter specifically "For apache: LogLevel debug", however on clicking OK am presented with the following error:

'Invalid Apache configuration: Syntax error on line 1 of /var/www/vhosts/system/wmdstudios.co.uk/conf/vhost.conf: Invalid command 'For', perhaps misspelled or defined by a module not included in the server configuration'

I have also tried to enter "RewriteLogLevel 3", this seems to have worked, is this correct?

Can you confirm, that you followed the official guideline for your ".htaccess" file for multisites? ( Reference: http://codex.wordpress.org/Create_A_Network )

- Yes I can confirm I followed this. I have also just double checked my Network Setup VS my .htaccess and have just noticed that the code given in Network Setup appears to be wrapped in <IfModule mod_rewrite.c> / </IfModule> tags in my .htaccess file. Could this be causing an issue?

Can you as well confirm, that you created additional nginx - rewrite rules, if you use nginx as well, according to your ".htaccess" - file? ( nginx ignores ".htaccess" - files, so you have to convert them for nginx.

- I have not created any additional rules in the .htaccess or made any changes other than when I upgraded the installation to multisite. I am unsure specifically if I am using nginx, the only reference I have seen to this is in Server > Services Management > PHP-FPM support for nginx which is un-selected and upon hover displays the message "Service is not installed"

Please consider to list your plugins for further investigations and please add additional informations to your webserver usage ( apache, apache+nginx, apache+nginx+php5-fpm ?!? ).

- Sure, I have listed the plugins in use on the network below as well as whether they are Network Active or active on specific sites only. As for server set up I am running Apache/2.2.15, PHP 5.4.37 and this domain is running as a FastCGI Application

AutoChimp: Individual Site
Cron GUI: Individual Site
Easy Smooth Scroll Links: Network Activated
Force Regenerate Thumbnails: Individual Site
Google Analytics +: Network Activated
Insert HTML Snippet: Individual Site
iThemes Security: Network Activated
Jetpack by WordPress.com: Network Activated
Plugin Activation Status: Network Activated
PopUp Pro: Individual Site
Responsive Lightbox: Network Activated
SB-RSS_feed-plus: Individual Site
SessionCam: Individual Site
Snapshot: Network Activated
Social King: Individual Site
Unfiltered MU: Network Activated
Unveil Lazy Load: Network Activated
W3 Total Cache: Network Activated
WooCommerce: Individual Site
WooCommerce Coupon Links: Network Activated
WordPress MU Domain Mapping: Network Activated
WP Smush Pro: Network Activated
WP-Mail-SMTP: Network Activated
WPMU DEV Dashboard: Network Activated
WP-Optimize: Network Activated
Yoast SEO: Network Activated

Thank you for your support on this.
 
Hi Dominic Vermeulen-Smith,

- Can you please confirm exactly what to enter here? I have tried to enter specifically "For apache: LogLevel debug", however on clicking OK am presented with the following error:

'Invalid Apache configuration: Syntax error on line 1 of /var/www/vhosts/system/wmdstudios.co.uk/conf/vhost.conf: Invalid command 'For', perhaps misspelled or defined by a module not included in the server configuration'

I have also tried to enter "RewriteLogLevel 3", this seems to have worked, is this correct?

yes and no... :

No: I mentioned the part "For apache", because you have the choice to add additional directives for apache and nginx at "Websites & Domains > <domain_name> > Web Server Settings". The suggested input part would have been "LogLevel debug" - nothing more.
Yes: you can use as well, the rewrite - module.

Please READ errors and try to understand them:
'Invalid Apache configuration: Syntax error on line 1 of /var/www/vhosts/system/wmdstudios.co.uk/conf/vhost.conf: Invalid command 'For', perhaps misspelled or defined by a module not included in the server configuration'
As you can see, the syntax error starts at the word "For" ( you used the information part from my suggestion as well "For apache:" ).​


- Yes I can confirm I followed this. I have also just double checked my Network Setup VS my .htaccess and have just noticed that the code given in Network Setup appears to be wrapped in <IfModule mod_rewrite.c> / </IfModule> tags in my .htaccess file. Could this be causing an issue?
No. This is correct.


- Sure, I have listed the plugins in use on the network below as well as whether they are Network Active or active on specific sites only. As for server set up I am running Apache/2.2.15, PHP 5.4.37 and this domain is running as a FastCGI Application
Especially this plugin needs additional rewrite rules: W3 Total Cache: Network Activated
The needed additional rewrite rules depend on your settings for "W3 Total Cache". Please ask questions regarding this plugin at their support page: https://wordpress.org/support/plugin/w3-total-cache or try to read the included documentation.


Again to your initial error:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Please post the complete ".htaccess" file, if you are unsure about the correct content, but please be aware, that possible additional rewrite rules from for example "W3 Total Cache" should be discussed and investigated in the above mentioned support - forum.

After you now enabled debug logging, did you see any new errors? Or additional informations in your domain - specific logs?


To install the "PHP-FPM support for nginx", it is necessary to have nginx installed as well. Please check the Plesk documentation, if you need further informations, how to install additional components:

 
Especially this plugin needs additional rewrite rules: W3 Total Cache: Network Activated
The needed additional rewrite rules depend on your settings for "W3 Total Cache". Please ask questions regarding this plugin at their support page: https://wordpress.org/support/plugin/w3-total-cache or try to read the included documentation.

Yes, sorry, when I said "I have not created any additional rules in the .htaccess", I meant I haven't personally. W3TC and iThemes Security have both added a large number of rules into my .htaccess file.

Please post the complete ".htaccess" file, if you are unsure about the correct content, but please be aware, that possible additional rewrite rules from for example "W3 Total Cache" should be discussed and investigated in the above mentioned support - forum.

I will post my .htaccess separately as it is too long to fit in one reply.

After you now enabled debug logging, did you see any new errors? Or additional informations in your domain - specific logs?

Yes, I am now regularly seeing these errors which I was not before:

'[debug] mod_headers.c(743): headers: ap_headers_output_filter()'

However, it does not seem to coincide with any of the redirect error messages I am trying to investigate.

To install the "PHP-FPM support for nginx", it is necessary to have nginx installed as well. Please check the Plesk documentation, if you need further informations, how to install additional components:

I don't specifically want to install nginx, unless it is recommended as part of resolving this issue or another reason.
 
# BEGIN iThemes Security - Do not modify or remove this line
# iThemes Security Config Details: 2
<IfModule mod_rewrite.c>
RewriteEngine On

# Disable PHP in Uploads - Security > Settings > System Tweaks > Uploads
RewriteRule ^wp\-content/uploads/.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]

# Reduce Comment Spam - Security > Settings > System Tweaks > Comment Spam
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} /wp-comments-post\.php$
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule ^.* - [F]
</IfModule>
# END iThemes Security - Do not modify or remove this line

# BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
AddType text/xml .xml
AddType video/asf .asf .asx .wax .wmv .wmx
AddType video/avi .avi
AddType image/bmp .bmp
AddType application/java .class
AddType video/divx .divx
AddType application/msword .doc .docx
AddType application/vnd.ms-fontobject .eot
AddType application/x-msdownload .exe
AddType image/gif .gif
AddType application/x-gzip .gz .gzip
AddType image/x-icon .ico
AddType image/jpeg .jpg .jpeg .jpe
AddType application/json .json
AddType application/vnd.ms-access .mdb
AddType audio/midi .mid .midi
AddType video/quicktime .mov .qt
AddType audio/mpeg .mp3 .m4a
AddType video/mp4 .mp4 .m4v
AddType video/mpeg .mpeg .mpg .mpe
AddType application/vnd.ms-project .mpp
AddType application/x-font-otf .otf
AddType application/vnd.ms-opentype .otf
AddType application/vnd.oasis.opendocument.database .odb
AddType application/vnd.oasis.opendocument.chart .odc
AddType application/vnd.oasis.opendocument.formula .odf
AddType application/vnd.oasis.opendocument.graphics .odg
AddType application/vnd.oasis.opendocument.presentation .odp
AddType application/vnd.oasis.opendocument.spreadsheet .ods
AddType application/vnd.oasis.opendocument.text .odt
AddType audio/ogg .ogg
AddType application/pdf .pdf
AddType image/png .png
AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
AddType audio/x-realaudio .ra .ram
AddType application/x-shockwave-flash .swf
AddType application/x-tar .tar
AddType image/tiff .tif .tiff
AddType application/x-font-ttf .ttf .ttc
AddType application/vnd.ms-opentype .ttf .ttc
AddType audio/wav .wav
AddType audio/wma .wma
AddType application/vnd.ms-write .wri
AddType application/font-woff .woff
AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
AddType application/zip .zip
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css A31536000
ExpiresByType text/x-component A31536000
ExpiresByType application/x-javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType text/javascript A31536000
ExpiresByType text/x-js A31536000
ExpiresByType text/html A3600
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType text/xml A3600
ExpiresByType video/asf A31536000
ExpiresByType video/avi A31536000
ExpiresByType image/bmp A31536000
ExpiresByType application/java A31536000
ExpiresByType video/divx A31536000
ExpiresByType application/msword A31536000
ExpiresByType application/vnd.ms-fontobject A31536000
ExpiresByType application/x-msdownload A31536000
ExpiresByType image/gif A31536000
ExpiresByType application/x-gzip A31536000
ExpiresByType image/x-icon A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType application/json A31536000
ExpiresByType application/vnd.ms-access A31536000
ExpiresByType audio/midi A31536000
ExpiresByType video/quicktime A31536000
ExpiresByType audio/mpeg A31536000
ExpiresByType video/mp4 A31536000
ExpiresByType video/mpeg A31536000
ExpiresByType application/vnd.ms-project A31536000
ExpiresByType application/x-font-otf A31536000
ExpiresByType application/vnd.ms-opentype A31536000
ExpiresByType application/vnd.oasis.opendocument.database A31536000
ExpiresByType application/vnd.oasis.opendocument.chart A31536000
ExpiresByType application/vnd.oasis.opendocument.formula A31536000
ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
ExpiresByType application/vnd.oasis.opendocument.text A31536000
ExpiresByType audio/ogg A31536000
ExpiresByType application/pdf A31536000
ExpiresByType image/png A31536000
ExpiresByType application/vnd.ms-powerpoint A31536000
ExpiresByType audio/x-realaudio A31536000
ExpiresByType image/svg+xml A31536000
ExpiresByType application/x-shockwave-flash A31536000
ExpiresByType application/x-tar A31536000
ExpiresByType image/tiff A31536000
ExpiresByType application/x-font-ttf A31536000
ExpiresByType application/vnd.ms-opentype A31536000
ExpiresByType audio/wav A31536000
ExpiresByType audio/wma A31536000
ExpiresByType application/vnd.ms-write A31536000
ExpiresByType application/font-woff A31536000
ExpiresByType application/vnd.ms-excel A31536000
ExpiresByType application/zip A31536000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
<FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
FileETag MTime Size
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public"
Header unset Set-Cookie
Header set X-Powered-By "W3 Total Cache/0.9.4.1"
</IfModule>
</FilesMatch>
<FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
FileETag MTime Size
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public"
Header set X-Powered-By "W3 Total Cache/0.9.4.1"
</IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|WOFF|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
FileETag MTime Size
<IfModule mod_headers.c>
Header set Pragma "public"
Header append Cache-Control "public"
Header set X-Powered-By "W3 Total Cache/0.9.4.1"
</IfModule>
</FilesMatch>
# END W3TC Browser Cache
# BEGIN W3TC CDN
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
# END W3TC CDN
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteRule .* - [E=W3TC_SSL:_ssl]
RewriteCond %{SERVER_PORT} =443
RewriteRule .* - [E=W3TC_SSL:_ssl]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=W3TC_ENC:_gzip]
RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
RewriteRule .* - [E=W3TC_PREVIEW:_preview]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{REQUEST_URI} \/$
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond %{HTTP_USER_AGENT} !(W3\ Total\ Cache/0\.9\.4\.1) [NC]
RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
</IfModule>
# END W3TC Page Cache core
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

</IfModule>


# END WordPress
 
[debug] mod_headers.c(743): headers: ap_headers_output_filter()

This is not an error - more an information. It results from caching functionalities and may appear from to time to time. Only visible in debug - loglevel and not related to your initial issue.​

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Back to your initial error:
Investigating your ".htaccess" - file, there is nothing unusual, when using caching and the security options are reasonable ( I still recommend to use "Fail2Ban", instead of the security module! ).

You need to disable all modules and re-enable each module one-by-one, to see, which of your plugins has misconfigurations. It can be a bit timeinvesting for you, but you are only able to investigate the cause of your issue, if you eliminate addons and plugins to the basic wordpress installation, if the issue/problem/failure can't be investigated with logs.​
 
Thanks again for your help and the information.

I have not had a chance to go back and work through these, and am reluctant to start as I don't know what actions actually cause the redirect error, therefore it will be difficult to know if disabling an addon or plugin has worked, as I would not know whether to expect the error to occur at any particular time.

I am also confused where there is not a way to use logs to investigated. The error states "Use 'LogLevel debug' to get a backtrace.", so presumably there is a backtrace and so far I have not set the correct setting to retrieve it?
 
Back
Top