Forum Moderators: phranque
First, is there any convention on where in the filesystem one should put a RewriteMap perl script (with Apache 2 on Debian) and the RewriteLock file? And does the RewriteLock file have to exist already, or does Apache create it at the specified location?
Secondly, am I right in thinking that a RewriteMap perl script is started with Apache, and can create, change and keep arrays in memory until the next restart of Apache?
Thank you,
Peter.
The lock file is dynamically-created, and you should not have to create it unless the server permissions are configured 'differently,' allowing mod_rewrite to write to, but not create the lock file. In that case, you'd want to create an empty writeable file for Apache to start with.
RewriteMap prg scripts are started with Apache, and 'listen' to STDIN, where the requests initiated by mod_rewrite referencing ${MapName:Key} appear. Output goes back to mod_rewrite on STDOUT.
Jim
There's a directory /var/lock/apache2/ which seems to be appropriate. Apache doesn't leave any trace of a lock file here, but doesn't complain, so I suppose it's working.
Two surpises (they shouldn't have been, but I mention them in case it's useful for anyone), Top shows the perl script running under root, and you must make sure that the output ends with a return: in other words, print "F\n" for instance rather than just print"F".
Regards,
Peter.