Posted on January 23, 2014 at 4:21 pm
Enable mod_auth module in Lighttpd (/etc/lighttpd/lighttpd.conf) config file:
server.modules = ( [...] "mod_auth", )
Inside the vhost config file write this:
auth.backend = "htpasswd" auth.backend.htpasswd.userfile = "/path/to/file/.htpasswd" auth.require = ( "/folder-to-protect/" => ( "method" => "basic", "realm" => "Please enter your Password.", "require" => "valid-user" ), )
Make sure the file .htpasswd exists, it contains the username and password, ex:
To generate the encrypted password, use Htpasswd Password Generator.
Now restart Lighttpd service:
If you type in the web browser the address:
You will need to enter the username and password.
- Best Google Fonts for Your Web Projects
- Increase volume of videos online for free
- Import GnuGPG Public and Private Key
- Encrypt and Decrypt Large Files with GnuGPG on Linux
- Encrypt and Decrypt Large Files with OpenSSL on Linux
- WordPress Migrate from HTTP to HTTPS
- How to check if a website is a scam?