This document will focus on setting up the .htaccess for use with EZSurvey.
Limit users access to a directory:
Create the .htaccess file:
A basic setup for the .htaccess file would look like this:
AuthUserFile /usr/users/company/website/project/.htpasswd AuthGroupFile /dev/null AuthName "Restricted Directory" AuthType Basic <Limit GET POST> require valid-user </Limit> |
A better setup for the .htaccess file would look like this
DirectoryIndex ezs.cgi IndexIgnore * AuthType Basic AuthName "EZSurvey CGI" AuthUserFile /usr/users/company/website/project/.htpasswd <Files *.asc> require valid-user </Files> <Files *.xml> Require user admin </Files> <Files *.ini> order deny,allow deny from all </Files> <Files *.sum> order deny,allow deny from all </Files> <Files *.val> order deny,allow deny from all </Files> |
The field
To create a new password file (where user_name is the name of a user) type this in at the command prompt:
htpasswd -c
To add a new name to the password file (where new_name is the name of a user) type this in at the command prompt:
htpasswd .htpasswd new_name