Difference between revisions of "Require Login"

From Amahi Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
We have a budding feature to require login to individual webapps.
 +
 +
Note - each app may have created a corresponding webapp. It's in this webapp that the Login Required may be selected.
 +
 +
If selected, this settings makes it such that the application will ask for a user name and a password.
 +
 +
Unfortunately this is no integrated yet with the rest of the user/password system already in place, so for now, it has to be done using htaccess controls.
 +
 +
We have decided to make these a global setting, i.e. the users and password are all the same to all the apps that require login.
 +
 +
== How to do it ==
 +
 +
This requires that an htaccess file and an htpassword file be created in a place that it's accessible to the web server.
 +
 
To create an <code>htpasswd</code> file containing the users and passwords
 
To create an <code>htpasswd</code> file containing the users and passwords
 
* you can go to a [http://www.webmaster-toolkit.com/htaccess-generator.shtml public htaccess/htpasswd generator] and copy the contents of what the "And this is what your .htpasswd file should look like..." box has  
 
* you can go to a [http://www.webmaster-toolkit.com/htaccess-generator.shtml public htaccess/htpasswd generator] and copy the contents of what the "And this is what your .htpasswd file should look like..." box has  

Revision as of 21:10, 4 May 2009

We have a budding feature to require login to individual webapps.

Note - each app may have created a corresponding webapp. It's in this webapp that the Login Required may be selected.

If selected, this settings makes it such that the application will ask for a user name and a password.

Unfortunately this is no integrated yet with the rest of the user/password system already in place, so for now, it has to be done using htaccess controls.

We have decided to make these a global setting, i.e. the users and password are all the same to all the apps that require login.

How to do it

This requires that an htaccess file and an htpassword file be created in a place that it's accessible to the web server.

To create an htpasswd file containing the users and passwords

  • you can go to a public htaccess/htpasswd generator and copy the contents of what the "And this is what your .htpasswd file should look like..." box has
  • or you can use the htpasswd command (first time with -c)
         htpasswd -c .htpasswd USERNAME

The file should contain lines like this: USERNAME:3Ce3F4zRcVf42

The file should be owned by apache:apache and have 600 permissions, so copy it over, then, as root:

         cp .htpasswd /var/hda/web-apps/htpasswd
         chmod 600 /var/hda/web-apps/htpasswd
         chown apache:apache /var/hda/web-apps/htpasswd