Page 1 of 1

Password protect all the X3 installation

Posted: 24 Apr 2015, 05:14
by andreamarucci
Hello Karl, I'm thinking about to use X3 for a project where I've to realize a gallery that's password protected. I mean that no one will have access to that gallery but the people with user and password.

Since this feature is not yet builtin, do you have any suggestion on how can I do that?

Re: Password protect all the X3 installation

Posted: 24 Apr 2015, 11:55
by localhost
I think there's no other way until Karl create one.

See this thread: https://forum.photo.gallery/viewtopic.php?f=52&t=8585

Re: Password protect all the X3 installation

Posted: 24 Apr 2015, 15:10
by mjau-mjau
I can offer a short tutorial on how to password-protect the X3 entire website:

1. Open the root ".htaccess" file in any text editor, and paste the below anywhere into the document.
Code
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/path/public_html/.htpasswd
AuthGroupFile /dev/null
require valid-user
2. Change the AuthUserFile setting above to reflect your servers document root. To figure out your servers document_root, go to your X3 check page, and scroll down to find the "document_root". For our demo website, the document root is /var/www/x3/demo, and therefore we would use:
Code
AuthUserFile /var/www/x3/demo/.htpasswd
It will be different for your website naturally.

3. Create a username and encrypted password. Because the password needs to be encrypted, you need to use the following utility:
http://www.htaccesstools.com/htpasswd-generator/
Simply input your username and password, and the tool will output an encrypted string for you. Copy the outputted string, which may look something like this:
Code
username:$apr1$/J7F2ML7$S5p/dolWLBs7PJFIirYR80
4. Create a file ".htpasswd" in your X3 root folder.

5. Open the new ".htpasswd" in any text editor, and paste the encrypted string. Save.

Your website should now have industry-standard password protection!

* If you for some reason require multiple usernames and passwords, you can repeat step 3, and simply add additional logins on new lines in your ".htpasswd" file. In the example below, we have three usernames with their correlating encrypted passwords:
Code
username:$apr1$/J7F2ML7$S5p/dolWLBs7PJFIirYR80
batman:$apr1$BhIgniP8$2fSXkeDMpO0M6gUuLw1FW.
robin:$apr1$10/8UsXJ$oHYgz9gt1R3igWug1Mdb1/

Re: Password protect all the X3 installation

Posted: 24 Apr 2015, 16:39
by andreamarucci
Thanks for the tutorial. I'll use this one surely waiting for something built in :-)

Re: Password protect all the X3 installation

Posted: 01 Jun 2015, 02:52
by mjau-mjau
I have a question for you about passwords in X3. Please see this post:
https://forum.photo.gallery/viewtopic.p ... 507#p37507

Re: Password protect all the X3 installation

Posted: 08 Jun 2015, 15:00
by mjau-mjau
Password protected pages launched ...
https://forum.photo.gallery/viewtopic.php?f=51&t=8637