Building from Source
Prerequisites
Section titled “Prerequisites”| Dependency | Minimum Version | Package |
|---|---|---|
| CMake | 3.14 | cmake |
| GCC or Clang | C11 support | gcc / clang |
| C++ compiler | C++17 (tests only) | g++ / clang++ |
| libcrypt | any | libcrypt-devel / libcrypt-dev |
Quick Build (LiteHTTPD-Thin)
Section titled “Quick Build (LiteHTTPD-Thin)”Building just the module produces LiteHTTPD-Thin — the .so file that runs on stock OLS. For LiteHTTPD-Full, you also need to apply the OLS patches and rebuild the OLS binary (see Patches), or install the pre-built openlitespeed-litehttpd RPM.
# Release build (module only -- produces Thin edition)cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFFcmake --build build -j$(nproc) --target litehttpd_htaccess
# Output: build/litehttpd_htaccess.soFull Build (module + tools + tests)
Section titled “Full Build (module + tools + tests)”cmake -B build -DCMAKE_BUILD_TYPE=Debugcmake --build build -j$(nproc)
# Run all 1036 testsctest --test-dir build --output-on-failure -j$(nproc)Build Targets
Section titled “Build Targets”| Target | Output | Description |
|---|---|---|
litehttpd_htaccess | litehttpd_htaccess.so | LSIAPI module |
litehttpd-confconv | litehttpd-confconv | Config converter CLI |
unit_tests | tests/unit_tests | Unit test binary |
property_tests | tests/property_tests | Property-based tests |
compat_tests | tests/compat_tests | Compatibility tests |
confconv_tests | tests/confconv_tests | Config converter tests |
Build with Sanitizers
Section titled “Build with Sanitizers”cmake -B build -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \ -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"cmake --build build -j$(nproc)ASAN_OPTIONS=detect_leaks=0 ctest --test-dir build --output-on-failureCross-compilation (ARM64)
Section titled “Cross-compilation (ARM64)”cmake -B build-arm64 \ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=OFFcmake --build build-arm64 --target litehttpd_htaccess