开发者

is restarting apache service needed with any changes to rewritemap file?

开发者 https://www.devze.com 2023-01-21 20:13 出处:网络
I am using a perl开发者_C百科 script file as a map file in RewriteMap directive. As i read the apache load the script once at the beginning, So is it needed to reload or restart apache after any chang

I am using a perl开发者_C百科 script file as a map file in RewriteMap directive. As i read the apache load the script once at the beginning, So is it needed to reload or restart apache after any changes to this script file?


Yes, rewrite maps are only registered when Apache is starting. And when using external programs as rewrite maps (i.e. map type pgr) the program files need to be locked with RewriteLock:

This directive sets the filename for a synchronization lockfile 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.

But the other map types can be changed afterwards:

For plain text and DBM format files the looked-up keys are cached in-core until the mtime of the mapfile changes or the server does a restart. This way you can have map-functions in rules which are used for every request. This is no problem, because the external lookup only happens once!


I'm not sure if the response above is correct, reload seems to be fine.

You can do "ps aux | grep YOUR_REWRITE_PROGRAM" to check the PID/start time of your rewrite map program.

Apache reload seems to set a new PID/start time for these processes, so I would assume new processes have started, a reload may be fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消