Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:config:rewrite-logs [2015/07/30 19:12]
Michael Alegre [For Native LSWS Installations]
litespeed_wiki:config:rewrite-logs [2020/05/07 18:36] (current)
Jackson Zhang [For Installations Using Apache Configuration Files]
Line 25: Line 25:
 If your installation of LSWS is using Apache'​s configuration files, you will need to enable rewrite logging in your Apache configurations. If your installation of LSWS is using Apache'​s configuration files, you will need to enable rewrite logging in your Apache configurations.
  
-First, ​you will need to designate a file for the rewrite log. This is done at the server ​level (in Apache'​s ​''​httpd.conf''​ file) with the RewriteLog directiveFor example:+First, ​''​RewriteLog''​ directive DON'T work for LiteSpeed since LSWS will write rewrite logs to the server'​s ​error_log 
  
-  RewriteLog "/​usr/​local/​var/​apache/​logs/​rewrite.log"+Second, LiteSpeed supports ''​RewriteLogLevel''​ directive to define ​rewrite log level. ​
  
-You need to locate the virtual host where the error is occurring so you can set the rewrite log level for that virtual host. If you are using cPanel, everything is usually in your ''​httpd.conf''​ file. Other setups may have virtual hosts in separate directories.+You need to locate the virtual host where the error is occurring ​(**note:​make sure you set it on the right virtual host, such as 80 virtual host , or 443 virtual host, or both if required. You won't see any rewrite log output if you set to the wrong virtual host, such as setting to 80 one but your testing is on 443.**) ​so you can set the rewrite log level for that virtual host. 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: 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+  ​ 
 +  <​IfModule LiteSpeed>​ 
 +  ​RewriteLogLevel ​
 +  </​IfModule>​
  
 Graceful restart LSWS so the changes will take effect. Graceful restart LSWS so the changes will take effect.
  
-More information on Apache rewrite log configuration can be found in [[http://​httpd.apache.org/​docs/​2.2/​mod/​mod_rewrite.html|the Apache mod_rewrite documentation]].+New Apache 2.4 rewrite log directive "​LogLevel alert rewrite:​trace3"​ is not yet supported by LiteSpeed, hence you can use the above rewrite log directive "​RewriteLogLevel 2" to enable rewrite log for LiteSpeed even you run apache 2.4.   
 + 
 +More information on Apache rewrite log configuration can be found in [[http://​httpd.apache.org/​docs/​2.2/​mod/​mod_rewrite.html|the Apache mod_rewrite documentation]]. ​
  • Admin
  • Last modified: 2015/07/30 19:12
  • by Michael Alegre