1833420 Members
3122 Online
110052 Solutions
New Discussion

.htaccess

 
SOLVED
Go to solution
Michael_33
Regular Advisor

.htaccess

Hi again,

I have put the .htaccess and .htpasswd .htgroup
to the /opt/webdocs, but it doesn't pop up
the password window.

Can someone post the 3 files? and how to set
it up?

Thanks!
11 REPLIES 11
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

Did you include this in your httpd.conf:


AllowOverride all
Order allow,deny
Allow from all


Your .htaccess should like something like this:

AuthUserFile /etc/htpasswds/.htpasswd
AuthName "This is a test"
AuthType Basic


require valid-user


NOTE: For security reasons, your .htaccess should NOT reside in the same directory as your .htpasswd.

Use the htpasswd command to create the password file .htpasswd.

Hope this helps. Regards.

Steven Sim Kok Leong
Michael_33
Regular Advisor

Re: .htaccess

thanks, how about .htgroup, no need?
sorry for giving 7 point, I just want
to continue.
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

I missed that out.

.htgroup

The format of the group file is one line per group, with the line containing the group name, followed by a colon, followed by the users in the group. Users are separated by commas e.g.

all:steven, michael
admins:michael

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

If you want to use .htgroup as well, then your .htaccess should look something like this:

AuthUserFile /etc/htpasswds/.htpasswd
AuthGroupFile /etc/htpasswds/.htgroup
AuthName "This is a test"
AuthType Basic


require valid-user


Hope this helps. Regards.

Steven Sim Kok Leong
Michael_33
Regular Advisor

Re: .htaccess

thanks ! and no other thing to take care?
Steven Sim Kok Leong
Honored Contributor
Solution

Re: .htaccess

Hi,

On my webserver, I don't have that many users that would require authentication based on groups (i.e. identical users in different groups etc), thus I only rely on .htpasswd and .htaccess. Changes to note include the AuthUserFile specification in .htaccess and the modifications in httpd.conf.

That works for me without any problems. I used a lot of .htpasswd authentication on my website: https://www.beepz.com

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

On my webserver, I don't have that many users that would require authentication based on groups (i.e. identical users in different groups etc), thus I only rely on .htpasswd and .htaccess. Changes to note include the AuthUserFile specification in .htaccess and the modifications in httpd.conf.

That works for me without any problems. I used a lot of .htpasswd authentication on my website: https://www.beepz.com

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

On my webserver, I don't have that many users that would require authentication based on groups (i.e. identical users in different groups etc), thus I only rely on .htpasswd and .htaccess. Changes to note include the AuthUserFile specification in .htaccess and the modifications in httpd.conf.

That works for me without any problems. I used a lot of .htpasswd authentication on my website: https://www.beepz.com

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

On my webserver, I don't have that many users that would require authentication based on groups (i.e. identical users in different groups etc), thus I only rely on .htpasswd and .htaccess. Changes to note include the AuthUserFile specification in .htaccess and the modifications in httpd.conf.

That works for me without any problems. I used a lot of .htpasswd authentication on the links in my website: https://www.beepz.com

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

On my webserver, I don't have that many users that would require authentication based on groups (i.e. identical users in different groups etc), thus I only rely on .htpasswd and .htaccess. Changes to note include the AuthUserFile specification in .htaccess and the modifications in httpd.conf. In addition, remember to check the ownership and permissions of .htaccess, .htpasswd and .htgroup. The nobody (or apache or httpd depending on which is used) UNIX user account must have read permissions to these files.

That works for me without any problems. I used a lot of .htpasswd authentication on the links in my website: https://www.beepz.com

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: .htaccess

Hi,

Please ignore the duplicate postings. I have problems posting in the forum just now. Ignore all the duplicates except the last post before this.

Sorry about the duplicates. Please kindly ignore then. Thanks. Regards.

Steven Sim Kok Leong