LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   .htaccess setup (https://www.linuxquestions.org/questions/linux-software-2/htaccess-setup-125382/)

jchristman 12-12-2003 08:56 PM

.htaccess setup
 
I have been trying to setup apache for the use of .htaccess files, with no luck.

I have followd everything on the websites I could find and still nothing could someone tell me what all needs done to the httpd.conf file
the .htaccess, .htpasswd and where they actually go and what permisions should be on them including who should the owner of the files be.

my .httaccess file

AuthUserFile /var/www/html/DIRECTORY/.htpasswd
AuthGroupFile /dev/null
AuthName "Private Page"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

its permission are
owned by apache.apache
mod - 644



my .htpasswd file
owned by apache.apache
mod - 600


and the httpd.conf file

I made this change

AllowOverride none - to - AllowOverride AuthConfig

jchristman 12-12-2003 09:18 PM

Ok, I have it actually asking for the login now, but I can not get it to read the .htpasswd file and allow access

guardian653 12-12-2003 09:24 PM

using the basic auth with apache (using flat files) has been very unsuccessful for me, if I were you I would use mod_auth_mysql and setup a database with users and groups (easier and faster)

but if you can't for some reason use that...
try

htpasswd -c .htpasswd
htpasswd username password

also I wouldn't keep that file in your wwwroot, I would keep it outside (if you can) that directory

Dave

jchristman 12-12-2003 09:50 PM

I did move it out of that directory path, the only reason I was going to use the .htaccess. was for the security popup window.

guardian653 12-12-2003 10:45 PM

AuthUserFile /usr/local/www/data/test2/.htpasswd
AuthGroupFile /dev/null
AuthName "Test Site"
AuthType Basic
or
AuthType Digest

<Limit GET POST>
require valid-user
</Limit>

try that as your .htaccess (change the Userfile path of course)
then

htpasswd -cd .htaccess [username]
or
htpasswd -c .htaccess [username]
or (for md5 digest)
htpasswd -cm .htaccess [username]

also make sure that both your .htaccess file and .htpasswd file are given full ownership to your web server account (e.g. chown www:www .ht*)

After trying this for a while I was able to get it to work, though, I don't see what I did other than restarting it serveral times. I also enabled mod_auth_digest, but I'm not using it...

Any one else want to take this on?

Dave

jchristman 12-13-2003 09:28 AM

Thank you for your help
basically, I had to go through the same thing to get it going,
and I still am not for sure what I did any differant than before.
besides the restarting for everychange i tried. I did activate the same auth mods like you but I am not using them either.


All times are GMT -5. The time now is 05:22 PM.