项目作者: kakwa

项目描述 :
htpasswd-editor is a simple Perl CGI to manage htpasswd files
高级语言: Perl
项目地址: git://github.com/kakwa/htpasswd-editor.git
创建时间: 2013-07-29T07:16:37Z
项目社区:https://github.com/kakwa/htpasswd-editor

开源协议:MIT License

下载


htpasswd-editor

htpasswd-editor is a simple Perl CGI to manage htpasswd files.

License

MIT

It’s an evolution of: http://www.perlmonks.org/?node_id=178482

Description

htpasswd-editor is a simple Perl CGI to manage htpasswd files. It permits to add, list or remove users,
it also permits an authentificated user to change his password. It can be useful for adding basic access
control management to a static website (ex: documentation generated from Markdown, Rst, Rdoc…).

Deployment

  • Create an htpasswd file:

    1. > htpasswd -c </path/to/htpasswd> <initial user>
  • Change the file’s rights:

    1. > chown www-data|apache2|httpd </path/to/htpasswd>
    2. > chmod 600 </path/to/htpasswd>
  • deploy the htpasswd.pl

    1. cp htpasswd.pl </path/to/cgi-dir>
    2. chmod 755 </path/to/cgi-dir>/htpasswd.pl
  • edit the settings hash at the begin of htpasswd.pl and change the entries dir and htpasswd.

    1. vim </path/to/cgi-dir>/htpasswd.pl
  • add the following configuration inside your vhost (htpasswd.pl is protected by the htpasswd it manages):

    1. ScriptAlias /cgi-bin/ </path/to/cgi-dir>
    2. <Directory "</path/to/cgi-dir>">
    3. AllowOverride None
    4. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    5. Order allow,deny
    6. Allow from all
    7. AuthName "restrict posting"
    8. AuthType Basic
    9. AuthUserFile </path/to/htpasswd>
    10. require valid-user
    11. </Directory>

Bitdeli Badge