Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

mod_pause

Minimal Apache httpd module that delays requests selected by Apache config before the request is passed to handlers such as mod_proxy_fcgi.

The module does not inspect User-Agent or URI itself. Use Apache <If expr> for matching, and put PauseDelayMs inside that block.

The delay runs in the fixups hook, after Apache has evaluated request config sections such as <If expr>, and before the content handler/proxy handler runs.

Build

make
sudo make install

This installs the module to /usr/local/lib/apache2/modules/mod_pause.so.

If apxs has another name on the server:

make APXS=/usr/bin/apxs2
sudo make install APXS=/usr/bin/apxs2

To install under another prefix:

sudo make install PREFIX=/opt/apache

Apache config

LoadModule pause_module /usr/local/lib/apache2/modules/mod_pause.so

<IfModule pause_module>
    <If "%{HTTP_USER_AGENT} =~ m#developers\.facebook\.com#i && %{REQUEST_URI} =~ m#^/shop/#">
        PauseDelayMs 1000
    </If>
</IfModule>

Then reload Apache.

About

Conditionally delay Apache requests

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages