Enable Long Directory Listing, Basic Auth and CGI
# -- foo
AddHandler cgi-script .cgi
Options ExecCGI Indexes MultiViews
IndexOptions +FancyIndexing +NameWidth=* +FoldersFirst +ScanHTMLTitles
## password begin ##
AuthUserFile /var/www/html/foo/.passwd
AuthName "Foo / Bar."
AuthType Basic
IndexOptions +NameWidth=* +FoldersFirst +ScanHTMLTitles
<Limit GET POST PUT>
require valid-user
</Limit>
<Files .passwd>
deny from all
</Files>
## password end ##
→ Save as .htaccess
Enable Long Directory Listing and CGI
# -- foo
AddHandler cgi-script .cgi .pl
Options ExecCGI Indexes MultiViews
IndexOptions +FancyIndexing +NameWidth=* +FoldersFirst +ScanHTMLTitles
Protect a CGI directory with .htaccess
httpd.conf
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride AuthConfig Limit
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
Make a sub directory e.g. prot in your cgi-bin directory and put this .htaccess file
into the prot directory:
# -- foo
## password begin ##
AuthUserFile /usr/local/apache2/cgi-bin/proj.passwd
AuthName "Foo / Bar."
AuthType Basic
<Limit GET POST PUT>
require valid-user
</Limit>
<Files .passwd>
deny from all
</Files>
## password end ##
|
|