Initial commit: mod_reqin_log Apache module

Features:
- JSON logging of HTTP requests to Unix domain socket
- Configurable HTTP headers logging (flat JSON structure)
- Header value truncation and count limits
- Automatic reconnect on socket disconnection
- Error reporting with throttling

Configuration directives:
- JsonSockLogEnabled: Enable/disable logging
- JsonSockLogSocket: Unix socket path
- JsonSockLogHeaders: List of headers to log
- JsonSockLogMaxHeaders: Maximum headers to log
- JsonSockLogMaxHeaderValueLen: Max header value length
- JsonSockLogReconnectInterval: Reconnect delay
- JsonSockLogErrorReportInterval: Error log throttle

Includes:
- Module source code (src/)
- Unit and integration tests (tests/, scripts/)
- Documentation (README.md, architecture.yml)
- Build configuration (CMakeLists.txt, Makefile)
- Packaging (deb/rpm)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Jacquin Antoine
2026-02-26 13:55:07 +01:00
commit 66549acf5c
27 changed files with 3550 additions and 0 deletions

1
packaging/deb/compat Normal file
View File

@ -0,0 +1 @@
10

27
packaging/deb/control Normal file
View File

@ -0,0 +1,27 @@
Source: mod-reqin-log
Section: web
Priority: optional
Maintainer: Developer <dev@example.com>
Build-Depends: debhelper (>= 10),
apache2-dev,
apache2,
build-essential,
pkg-config
Standards-Version: 4.5.0
Homepage: https://github.com/example/mod_reqin_log
Package: libapache2-mod-reqin-log
Architecture: any
Depends: apache2, ${shlibs:Depends}, ${misc:Depends}
Description: Apache HTTPD module for logging HTTP requests as JSON to Unix socket
mod_reqin_log is an Apache HTTPD 2.4 module that logs all incoming HTTP requests
as JSON lines to a Unix domain socket. The logging occurs at request reception
time (post_read_request phase), capturing input-side data without waiting for
application processing.
.
Features:
- Non-blocking I/O to avoid stalling worker processes
- Configurable header logging with truncation support
- Automatic reconnection to Unix socket on failure
- Throttled error reporting to Apache error_log
- Compatible with prefork, worker, and event MPMs

2
packaging/deb/install Normal file
View File

@ -0,0 +1,2 @@
usr/lib/apache2/modules/mod_reqin_log.so
etc/apache2/conf-available/mod_reqin_log.conf

24
packaging/deb/rules Normal file
View File

@ -0,0 +1,24 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_build:
$(MAKE) APXS=/usr/bin/apxs
override_dh_auto_install:
$(MAKE) install DESTDIR=$(CURDIR)/debian/libapache2-mod-reqin-log APXS=/usr/bin/apxs
install -d $(CURDIR)/debian/libapache2-mod-reqin-log/etc/apache2/conf-available/
install -m 644 conf/mod_reqin_log.conf $(CURDIR)/debian/libapache2-mod-reqin-log/etc/apache2/conf-available/mod_reqin_log.conf
override_dh_auto_clean:
$(MAKE) clean || true
dh_auto_clean
override_dh_strip_nondeterminism:
# Nothing to strip
override_dh_install:
dh_install
install -d $(CURDIR)/debian/libapache2-mod-reqin-log/usr/lib/apache2/modules/
install -m 755 .libs/mod_reqin_log.so $(CURDIR)/debian/libapache2-mod-reqin-log/usr/lib/apache2/modules/