Skip to content

Building from Source

DependencyMinimum VersionPackage
CMake3.14cmake
GCC or ClangC11 supportgcc / clang
C++ compilerC++17 (tests only)g++ / clang++
libcryptanylibcrypt-devel / libcrypt-dev

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.

Terminal window
# Release build (module only -- produces Thin edition)
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build build -j$(nproc) --target litehttpd_htaccess
# Output: build/litehttpd_htaccess.so
Terminal window
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j$(nproc)
# Run all 1036 tests
ctest --test-dir build --output-on-failure -j$(nproc)
TargetOutputDescription
litehttpd_htaccesslitehttpd_htaccess.soLSIAPI module
litehttpd-confconvlitehttpd-confconvConfig converter CLI
unit_teststests/unit_testsUnit test binary
property_teststests/property_testsProperty-based tests
compat_teststests/compat_testsCompatibility tests
confconv_teststests/confconv_testsConfig converter tests
Terminal window
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-failure
Terminal window
cmake -B build-arm64 \
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF
cmake --build build-arm64 --target litehttpd_htaccess