mod_realdoc is an Apache module which does a realpath on the docroot symlink and sets the absolute path as the real document root for the remainder of the request.

It executes as soon as Apache is finished reading the request from the client.

The realpath frequency can be adjusted in httpd.conf using:

<IfModule mod_realdoc.c>
    RealpathEvery 2
</IfModule>

By resolving the configured symlinked docroot directory to an absolute path at the start of a request we can safely switch this symlink to point to another directory on a deploy. Requests that started before the symlink change will continue to execute on the previous symlink target and therefore will not be vulnerable to deploy race conditions.

This module is intended for the prefork mpm. Threaded mpms will incur race conditions.



mod_realdoc是一个Apache模块,它执行一个实际路径 docroot符号链接并设置绝对路径为 请求的其余部分的真实文档根。

一旦Apache完成读取请求,它就会执行 从客户端。

可以使用以下方式在httpd.conf中调整实际路径频率:

<IfModule mod_realdoc.c>
    RealpathEvery 2
</IfModule>

通过将配置的符号链接的docroot目录解析为 在我们可以安全的请求开始时的绝对路径 切换此符号链接以指向其上一个目录 部署。在符号链接更改之前开始的请求 继续执行上一个符号链接目标 因此不会容易部署竞争条件。

此模块适用于prefork mpm。线程mpms 将招致竞争条件。




相关问题推荐