mod_rewrite RewriteMap lock error

mod_rewrite RewriteMap lock error

Post by alv » Sat, 26 Apr 1997 04:00:00



I'm using mod_rewrite with apache 1.2b7 on a SunOS machine.  I'm running
httpd at a high port number, so the process is running under my uid instead
of the usual "nobody".  I've used plain text files as RewriteMaps with few
problems.  When I try to use an executable script as a RewriteMap, though,
I receive an error: "Error getting lock. Exiting!" at my command line,
in the window where I started the server.  No error is logged in the
rewrite_log or the error_log, and the site is inaccessible.  The file and
directory are readable and executable, so I don't know what is causing this.  
I've tried this with the two sample RewriteMap scripts at www.engelschall.com
and I receive the same error.  What should I do?

Here is the portion of mod_rewrite.c that appears to generate the error.  
I'm not sure what it means, so any help would be appreciated.

---

#ifdef USE_FLOCK
    while (   ((rc = flock(fd, LOCK_EX)) < 0)
           && (errno == EINTR)               )
        continue;
#endif

    if (rc < 0) {
        fprintf(stderr, "Error getting lock. Exiting!");
        exit(1);
    }
    return;

Quote:}

--

Thanks.


 
 
 

mod_rewrite RewriteMap lock error

Post by Ralf S. Engelscha » Sun, 27 Apr 1997 04:00:00



> I'm using mod_rewrite with apache 1.2b7 on a SunOS machine.  I'm running
> httpd at a high port number, so the process is running under my uid instead
> of the usual "nobody".  I've used plain text files as RewriteMaps with few
> problems.  When I try to use an executable script as a RewriteMap, though,
> I receive an error: "Error getting lock. Exiting!" at my command line,
> in the window where I started the server.  No error is logged in the
> rewrite_log or the error_log, and the site is inaccessible.  The file and
> directory are readable and executable, so I don't know what is causing this.  
> I've tried this with the two sample RewriteMap scripts at www.engelschall.com
> and I receive the same error.  What should I do?
> Here is the portion of mod_rewrite.c that appears to generate the error.  
> I'm not sure what it means, so any help would be appreciated.
>[...flock on a pipe...]

Seems like the problem is that SunOS does not allow locking of pipes. This was
reported to my some time ago, too. But I don't know what we can do here,
except just disabling locking for SunOS, but then the RewriteMap behaviour can
be problematic because requests can conflict.

Greetings,
                                       Ralf S. Engelschall

                                       www.engelschall.com

 
 
 

1. Help with mod_rewrite and rewritemap

My site has some filenames with 2 or more spaces.
Some search engines substitute them with some + but in this way their
request can't reach the pages.
I am trying to use mod_rewrite to change the request substituting the
filename with + with the filename with %20.
I am trying to use a rewrite map but I'm not able to make it work.
This is what I wrote in the httpd.conf:

RewriteEngine On
RewriteLog "/home/mhd/rewrite.log"
RewriteLogLevel 9
RewriteMap berno     txt:/home/mhd/map.txt
RewriteRule ^/home/mhd/prova/www.domain.it/htdocs/(.*)
/home/mhd/prova/www.domain.it/htdocs/${berno:$1|$1}

In the map I put only a trial substitution such as:
pippo+prova.html   pippo%20prova.html

The log gave me this report:

init rewrite engine with requested uri /default.ida
applying pattern '^/home/mhd/prova/www.domain.it/htdocs/(.*)' to uri
'/default.ida'
pass through /default.ida

What is my mistake ?

2. nntp: Compilation Problems!?

3. mod_rewrite - ReWriteMap - Based on keywords

4. mail in iptables Tutorial 1.1.7

5. mod_rewrite: RewriteMap & HTTP_USER_AGENT

6. installing via PLIP

7. mod_rewrite and rewritemap efficiency

8. "pppd daemon died unexpectedly", Please HELP !!!

9. mod_rewrite - ReWriteMap - Based on keywords

10. Fatal Server Error: Could not create lock file in /tmp/.tX0-lock???

11. Mod_rewrite and its lock file on Apache 2

12. netscape rpm from compaq + my box = lock lock lock

13. Modem TX and RX status via Num Lock-Caps Lock-Scroll Lock