Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable loglevel debug on Apache2 server [closed]

My error.log contains:

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 replaced loglevel on apache config file:

LogLevel debug

After restarting, I'm getting the same error message without what could be called "a backtrace". As I understand there should be those 10 lines of redirects generated by mod_rewrite regex.

After searching all over the internet I've found plenty of explanations of loglevel and mod_rewrite, but not a word of how to make loglevel debug work.

Any ideas?

like image 867
Tiger Avatar asked Apr 12 '11 21:04

Tiger


People also ask

How is debugging in Apache done?

If you are debugging an apparent infinite loop, simply run gdb as above and type a Control-C -- gdb will interrupt the process and provide a prompt where it was stopped. and it will (hopefully) print a stack backtrace of where the core dump occurred during processing.


1 Answers

Do note that on newer Apache versions the RewriteLog and RewriteLogLevel have been removed, and in fact will now trigger an error when trying to start Apache (at least on my XAMPP installation with Apache 2.4.2):

AH00526: Syntax error on line xx of path/to/config/file.conf: Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration`

Instead, you're now supposed to use the general LogLevel directive, with a level of trace1 up to trace8. 'debug' didn't display any rewrite messages in the log for me.

Example: LogLevel warn rewrite:trace3

For the official documentation, see here.

Of course this also means that now your rewrite logs will be written in the general error log file and you'll have to sort them out yourself.

like image 200
sp00n Avatar answered Sep 19 '22 18:09

sp00n