- Windows
- Apache httpd 2.4.50 x64 VC16
- mod_authn_ntlm
Whatever you do, don't download the pre-built binaries from the repo's bin
directory because 1) the pre-built binaries are very old (2017) and are missing important fixes for Basic+NTLM, 2) the developers aren't providing new binaries, and 3) the AppVeyor build is either gone or private.
- Get a Windows computer.
- Install CMake for Windows x64 MSI.
- Download and extract Apache 2.4 x64 VC16.
- Clone, or download and extract latest source zip, of TQsoft-GmbH/mod_authn_ntlm, either the master branch or a release tag you want.
- Download Visual Studio Community 2017
- Go to Visual Studio Subscriptions.
- Sign in with a free Microsoft account.
- If it asks you to enroll for free in Visual Studio Dev Essentials, accept it.
- Download "Visual Studio Community 2017 (version 15.9)" x64 multi-language exe.
- I'm not sure if this would work with Visual Studio 2019 or later. You might need to implement a new generator.
- You also may be able to get away with only downloading the Build Tools for Visual Studio 2017 (version 15.9), which doesn't include the Visual Studio IDE GUI.
- Run the Visual Studio installer.
- When the installer asks you to choose workloads, select Desktop Development with C++.
- You can deselect the following optional components.
- Just-In-Time Debugger
- C++ Profiling Tools
- Test Adapter for Boost.Test
- Test Adapter for Google Test
- I left the following components enabled, but I'm not sure if they're strictly required.
- VC++ 2017 version 15.9
- Windows 10 SDK
- Visual C++ tools for CMake
- Visual C++ ATL for x86 and x64
- You can deselect the following optional components.
- Follow the build instructions from the repo.
- Go to the module repo directory
cd mod_authn_ntlm
- Generate solution
cmake -B ./build-x64 -S ./ -G "Visual Studio 15 2017" -A x64 -T host=x64 -DAPACHE_ROOT="C:\Program Files\Apache24"
- Compile
cmake --build ./build-x64 --config Release
- Go to the module repo directory
The generated artifact is build-x64\Release\mod_authn_ntlm.so
. Yes, it's an SO file, even though we're on Windows.
- Copy
mod_authn_ntlm.so
frombuild-x64\Release
toApache24\modules
.
Follow the Dependencies, Sample Config, and List of Available Parameters to configure the module.
This is from my server's httpd.conf
, where a specific directory is protected by Basic/NTLM authentication over TLS.
LoadModule auth_ntlm_module modules/mod_authn_ntlm.so
<Directory "c:/my/directory">
SSLRequireSSL
AuthType SSPI
AuthName "My Realm"
NTLMAuth On
NTLMAuthoritative On
NTLMOfferBasic on
NTLMOfferNTLM on
NTLMBasicPreferred off # enabling this would break clients like PowerShell and Office
NTLMDomain MYDOMAIN
Require valid-user
</Directory>