Difference between revisions of "Require Login"
From Amahi Wiki
(New page: 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] ...) |
|||
Line 2: | Line 2: | ||
* 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 | ||
* or you can use the htpasswd command (first time with -c) | * 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 contain lines like this: USERNAME:3Ce3F4zRcVf42 | ||
Line 8: | Line 8: | ||
The file should be owned by apache:apache and have 600 permissions, so copy it over, then, as root: | 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 |
Revision as of 10:51, 6 January 2009
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