This is an old revision of the document!


Enabling Rewrite Logs

The first step to debugging rewrite rules is to enable rewrite logging. Once rewrite logging has been enabled, you will be able to see rewrite log entries telling you which rewrite rule is not working and what is going wrong.

This wiki will guide you through the steps to enabling rewrite logging both for native LiteSpeed Web Server installations and installations running off Apache configuration files.

For Native LSWS Installations

Enabling rewrite logging in the WebAdmin console is very simple. First, locate the virtual host that is having the problem. Rewrite log entries will go in the virtual host's main log, so make sure the virtual host's Log Level setting (WebAdmin console > Configuration > Virtual Hosts > Log) is set to INFO or DEBUG. (Rewrite log entries are considered info level.)

Now, go to the Rewrite tab (WebAdmin console > Configuration > Virtual Hosts > Rewrite), and raise the Log Level setting.

Start the log level at a lower level so that you don't get flooded with information. Raise the level if you don't find the errors you need. (Raising your rewrite log level may slow down your server.)

Graceful restart so the changes will take effect.

For Installations Using Apache Configuration Files

If your installation of LSWS is using Apache's configuration files, you will need to enable rewrite logging in your Apache configurations.

In order to enable rewrite logging, you will first need to locate the virtual host where the error is occurring. If you are using cPanel, everything is usually in your httpd.conf file. Other setups may have virtual hosts in separate directories.

In your virtual host settings, add the RewriteLogLevel directive followed by a number for how detailed you want your logs to be. 1 is least detailed. 9 is most detailed. 0 will turn off rewrite logging. For example:

RewriteLogLevel 2

You will also need to designate a file for the rewrite log. This is done at the server level with the RewriteLog directive. For example:

RewriteLog "/usr/local/var/apache/logs/rewrite.log"

Graceful restart LSWS so the changes will take effect.

More information on Apache rewrite log configuration can be found in the Apache mod_rewrite documentation.

  • Admin
  • Last modified: 2013/08/13 19:46
  • by Michael