Skip to content

Instantly share code, notes, and snippets.

@MinaMikhailcom
Created October 18, 2017 13:51
Show Gist options
  • Select an option

  • Save MinaMikhailcom/b7619ed227c257b3b83e4511e8a65624 to your computer and use it in GitHub Desktop.

Select an option

Save MinaMikhailcom/b7619ed227c257b3b83e4511e8a65624 to your computer and use it in GitHub Desktop.

Revisions

  1. MinaMikhailcom created this gist Oct 18, 2017.
    17 changes: 17 additions & 0 deletions lighttpd.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    apt install apache2-utils
    htpasswd -c /etc/lighttpd/.htpasswd <Username> #Replace <Username>, you will be prompted to enter the password.

    # Make sure that "mod_auth" is loaded in "server.modules".

    nano /etc/lighttpd/lighttpd.conf
    #Add the following to lighttpd.conf.

    auth.backend = "htpasswd"
    auth.backend.htpasswd.userfile= "/etc/lighttpd/.htpasswd"
    auth.require = ( "/RestrictedURL" =>
    (
    "method" => "basic",
    "realm" => "Restricted!",
    "require" => "valid-user"
    ),
    )