To enable authentication in lighttpd is easy. We can follow this reference to set up a functional environment: Module mod_auth – Using Authentication. However, it is a tragedy in my new CentOS 6 box with lighttpd 1.4.31, due to the separated configuration files.
After I enable mod_auth in modules.conf, set up my authentication functions in conf.d/auth.conf and restart the service, the function seems no work. The issue is on a lost include command in main configuration file – lighttpd.conf, then configuration will not be loaded.
The solution is adding
include "conf.d/auth.conf" into lighttpd.conf and everything works fine. What a stupid problem. Enjoy it. 🙂