Changes

From Amahi Wiki
Jump to: navigation, search
1,587 bytes added ,  02:23, 8 August 2019
{{NeedsUpdateMessageBox|backgroundcolor = #faa|image =Warning.png|heading =WARNING|message = This is recommended only for advanced users, proceed with caution.}}We have a budding feature to require login to individual webapps<div style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">'''NOTE:''' The one-click [https://www.amahi.org/apps/web-apps Web Apps] will provide this capability in Amahi 7 or greater.</div>
Note - each app may have created a corresponding webapp. It's in this webapp that the Login Required may be selected.
Would you like to control which HDA users can access certain web applications? This can be easily done in Amahi 6. To use this function, select the web apps section in the apps tab. Expand the desired app and select the '''Require login''' check box. If selected, this settings makes it such that the application will ask for a user name and a password. The perform the steps below to create the <code>htpasswd</code> file.
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 '''NOTE:''' This is a global settingat the moment, i.e. the users and password are all the same to all the apps that require have '''Require login''' selected. This feature <u>IS NOT</u> compatible with [[Secure_App_Access|Access Web Apps over SSL]].
== How to do it ==
This requires creation of the <code>htpasswd</code> be placed in the '''''/var/hda/web-apps''''' directory. The <code>htpasswd</code> file will identify user names and passwords (encrypted).
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 ==== Create the htpasswd File ====There are two options for creating the <code>htpasswd</code> file containing the users and passwords:* you can go Option 1: Navigate to a [http://www.webmaster-toolkithtaccesstools.com/htaccesshtpasswd-generator.shtml public htaccess/htpasswd generatorGenerator] .<blockquote>*Enter desired Username, Password, and Path (physical location where <code>.htpasswd</code> will be stored). For example, Username '''''amahi''''', Password '''''amahi''''', and copy Path '''''/var/hda/web-apps'''''.*Select the contents of what '''Generate .htaccess''' button.*Copy the text from ''"And this is what your .htpasswd file should look like..." '' box has and paste it into the <code>.htpasswd</code> file. It should look similar to this: <pre>amahi:amb24e1pXrqFY</pre>* or you can use Proceed to the '''Copy and Set File Permissions''' section to complete.</blockquote>*Option 2: [[Open_Terminal_as_root|Open Terminal as root user]]<blockquote>*Create the <code>htpasswd command </code> file (first time with -cchange username and password):{{Code|<pre>htpasswd -c -b .htpasswd USERNAME}}username password</pre>*Proceed to the '''Copy and Set File Permissions''' section to complete.</blockquote>
The ==== User Maintenance (Add/Delete) ====*Add additional users, repeat the previous step ('''NOTE:''' the -c option is only needed the first time you create the file should contain lines like thisfor that web application): {{Text|USERNAME htpasswd -b /var/hda/web-apps/htpasswd username password*Delete a user, do the following:3Ce3F4zRcVf42}} htpasswd -D /var/hda/web-apps/htpasswd username
The ==== Copy and Set File permissions: ====*Copy the <code>.htpasswd</code> file should be owned by apacheto the web application directory:apache and have 600 cp .htpasswd /var/hda/web-apps/htpasswd* Ensure the permissions, so copy it over, then, are correctly set on the two files as rootfollows: chmod 600 /var/hda/web-apps/htpasswd chown apache:apache /var/hda/web-apps/htpasswd
{{Code|cp .htpasswd /var/hda/web-apps/htpasswdchmod 600 /var/hda/web-apps/htpasswdchown apache:apache /var/hda/web-apps/htpasswd}}==== If you have Webmin installed ====
= If *After logging into Webmin select “Others” on the left-hand side, click on “Protected Web Directories” and then select “Add protection for a new directory”.*In ''"Directory path"'' browse to/or enter the path to the <code>html</code> web directory you wish to protect, in ''“Authentication realm”'' enter something like for example ''“Authentication required”'' (this will show up on the popup login box) and then click on create.*Now you need to setup users to allow login by clicking on ''“Add a new user”'' in ''“Associated users and groups”'', when users have webmin installed =been created you should be good to go.
After logging into webmin select “Others” on the left-hand side, click on “Protected Web Directories” and then select “Add protection for a new directory”.
In “Directory path” browse to/or enter the path to the ‘html’ web directory you wish to protect, in “Authentication realm” enter something like for example “Authentication required” (this will show up on the popup login box) and then click on create. Now you need to setup users to allow login by clicking on “Add a new user” in “Associated users and groups”, when users have been created you should be good to go. Note'''NOTE: ''' After you have completed this process using webmin Webmin you can then select ''"un-protect selected directory" '' and use the HDA-Dashboard to enable/disable password protection.
12,424

edits