UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  eUKhost's Official Web Hosting Forum > Technical Support > VPS Hosting - Virtual Private Servers

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 20-12-2009, 21:31
Junior Member
 
Join Date: Aug 2007
Posts: 19
Default Apache error warning about missing RewriteLock

HI,
I've noticed that I get this warning whenever Apache restarts:
"Running external rewrite maps without defining a RewriteLock is DANGEROUS!"

In httpd.conf the following is found:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
</IfModule>

I don't have any password-protected directories (which is what I gather LeechProtect does) but I might do one day, so what is the best way to specify a RewriteLock?

From the comments at the top of httpd.conf it would seem best to alter the templates but I can't see which one sets the RewriteMap directive.

Can anyone advise the best way to update this?

Thanks,
Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 20-12-2009, 23:52
Rock's Avatar
Technical Support (eUKhost.com)
 
Join Date: Oct 2006
Location: localhost
Posts: 3,356
Send a message via MSN to Rock Send a message via Skype™ to Rock
Smile

Quote:
Originally Posted by davel View Post
HI,
I've noticed that I get this warning whenever Apache restarts:
"Running external rewrite maps without defining a RewriteLock is DANGEROUS!"

In httpd.conf the following is found:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
</IfModule>

I don't have any password-protected directories (which is what I gather LeechProtect does) but I might do one day, so what is the best way to specify a RewriteLock?

From the comments at the top of httpd.conf it would seem best to alter the templates but I can't see which one sets the RewriteMap directive.

Can anyone advise the best way to update this?

Thanks,
Dave
Hi Dave,

If the Apache documentation & log messages say something as dangerous, it really is dangerous & shouldn't be ignored..

Leeching occurs when users publicly post their username & password to a restricted area of your site, allowing other visitors to use the login information. cPanel can be configured to handle leeching, redirecting & potentially suspending the user. The protection function works by setting the maximum number of logins that can occur within a 2-hour time limit. If the login limit is exceeded, the user is presumed to be allowing other visitors to use his or her login information.

The RewriteLock directive can be used to define a lockfile which mod_rewrite can use to synchronize communication with the mapping program as stated above in use with LeechProtect. By default no such synchronization takes place. But there must be a rewritelock file for each server instance if your RewriteMap is a script.

Here's the exact text from the mod_rewrite documentation:
Quote:
RewriteLock: This directive sets the filename for a synchronization lock-file which mod_rewrite needs to communicate with RewriteMap programs. Set this lockfile to a local path (not on a NFS-mounted device) when you want to use a rewriting map-program. It is not required for other types of rewriting maps.
Syntax:
Quote:
RewriteLock /some/file/path
In this case of yours:
Quote:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock
</IfModule>
The lock file is needed to keep the stdin-stdout streams used to communicate with the mapping script single-threaded, so that various RewriteMap requests initiated by asynchronously-arriving HTTP requests don't end up 'mixing their characters' in these I/O streams with disastrous results to your URL mappings. No harm will come if you define a RewriteLock file & don't end up using it; It's simply a way to use the OS flock function to ensure that only one HTTP request's mapping request is writing stdin or reading stdout to communicate with the mapping script at any given time.

Let us know if you need any more assistance with this..
__________________

Rock _a.k.a._ Jack
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook

For complaints, grievances or suggestions kindly email our FeedBack Dept.
Proper action will be taken accordingly & instantaneously!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 21-12-2009, 19:18
Junior Member
 
Join Date: Aug 2007
Posts: 19
Default

Rock,
Thanks for the explanation of the need for the lock file.
I've updated httpd.conf by editing the file and when apache restarts the message disappears. Great.

However I gather from the comments at the top of httpd.conf it would seem best to alter the templates but I can't see which one sets the RewriteMap directive.

I've searched through the files in /usr/local/apache/conf for a template file which is included in httpd.conf when it is regenerated, but I can't see it.

Can you suggest the best way to determine which file it is in? I suppose rather than doing a search for the string using find, what I'm asking is :is there a way to determine which files are included in httpd.conf when it is regenerated?

Thanks,
Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 02:07.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
UK Web Hosting by eUKHosting 3.1.0
UK Web Hosting by eUKHosting 3.1.0
Copyright © 2001-2012, eUKhost LTD. All rights reserved.

 


UK VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

VoIP Dedicated Servers
Asterisk, Trixbox Dedicated Servers

Business Web Hosting
100% uptime Hosting

UK Cpanel Hosting
cPanel Shared Hosting

Domain Hosting
Cheap Domains & Hosting Plans

UK Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

ColdFusion Hosting
ColdFusion Web Hosting
 
 

Android and Apple App


knowledgebase articles
eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting

Joomla Hosting
Joomla Web Hosting

Mambo Hosting
Mambo Web Hosting

Magento Hosting
Magento Web Hosting

Wordpress Hosting
Wordpress Web Hosting

 

Web Hosting Affiliate Program
 

popular blog categories

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles