htaccess and htpasswd files in Cascade
Figured out how (with some help from DW) to create a folder within Cascade which does not appear in the navigation scheme and which is protected by .htaccess (i.e. requiring either a netlink, or requiring an arbitrary password you create).
To hide the folder in the UI of the site:
- select folder, click on Edit tab
- deselect "include when indexing" checkbox
- click submit
To restrict access to any netlink id, create a .htaccess file which contains the following and upload it to your folder:
AuthType Basic
AuthName "Restricted to any UVic Netlink"
AuthUserFile /usr/local/apache/uvic/netlink
Require valid-user
To restrict access to a list of netlink ids, your .htaccess file has to look like this:
AuthType Basic
AuthName "Restricted to certain UVic Netlinks"
AuthUserFile /usr/local/apache/uvic/netlink
Require user <sarneil mholmes gregster>
To restrict access to an arbitrary user that you've made up, the .htaccess file has to look like this (where the path following /home/wwwuvic/www/ is the path to your folder as displayed in the GUI of cascade):
AuthType Basic
AuthName "Restricted to myUser1"
AuthUserFile /home/wwwuvic/www/humanities/hcmc/testaccess/.htpasswd
Require user myUser1
You obviously also have to create a .htpasswd file and upload it into your folder. I did that by:
- logging in to my netlink account using the command line
- cd to a temp folder in my account
- to create the file and create 1 user: htpasswd -c .htpasswd myUser1
- to add another user : htpasswd .htpasswd myUser2
- change the name of the file to DOThtpasswd (may not be necessary)
- upload the file to the right folder in Cascade
- rename the file .htpasswd (only if you renamed it above)
The name you create cannot be a duplicate of a real netlink id.