Apache .htpasswd & .htaccess

Support section for FREESCO v0.3.x 3rd Party Packages

Postby Alanex » Sat Oct 04, 2008 8:08 pm

Hi all,
Having annoying problems with .htaccess and .htpasswd

The biggest problem is I don't know how to use them!

I've worked through a few tutorials via google, explaining how to use the files and none of it has worked. They all related to using them with Apache (yes, I have it installed and working!)

Here's what I have:

FREESCO 0.3.8
Apache 1.3.27
I have a new directory at /www/secure
which contains a few files including "index.htm" & "test.htm".

All the files work as expected, ie. images, etc

I have placed my .htpasswd & .htaccess in several places (according to various tutorials) and have yet to see any "Password" boxes appear!

I have had no errors and htpasswd did create files and the file did contain username and encrypted passwords. I just don't know what else I need to do and none of the tutorials mentioned anything else other than creating the files and occasionally using chmod on the files.
The most common .htaccess file was:

Code: Select all
AuthUserFile /www/secure/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Area"
AuthType Basic
 
require valid-user


Is there a tutorial that works for Apache on FREESCO? Or is there something all these tutorials is missing?

This is my biggest problem with *nix in general, not all tutorials work with all distros. Tho my biggest hate is when someone says use "this" command and all I get is "this is not a recognised file or command" THEN you find out that you have to mess around with paths,config files, blah blah blah.

So anyway, back to my problem... can anyone help or point to tutorial, etc...

My guess it's all down to the path in the .htaccess file? It's not clear whether it uses "/www/secure/.htaccess" or "/mnt/bootdev/etc...." or something entirely different!
Everyone of them mentions using "pwd" to get the path and it's always "/mnt/bootdev/blah/blah/www/secure/" and that's what I've been using mostly, but I have tried "/www/secure/".

Sorry for ranting on, but it's 2am and I've been tring to get it to work for 3+ hours.

Thanks in advance,
Alan.
User avatar
Alanex
Newbie
 
Posts: 9
Joined: Sun Mar 30, 2003 5:32 pm
Location: Scotland

Postby Lightning » Sat Oct 04, 2008 8:28 pm

Most likely your biggest problem is the main Apache configuration. Which is set by default to most ignor directory files and not allow changes. So do the following

edit /usr/local/apache/conf/httpd.conf
Code: Select all
#Find these lines and change "None" to "All"
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
# Change this
    AllowOverride None
# To this
    AllowOverride All


Then you can put the '.htaccess' file in the /www/secure directory.
This file should look something like this
Code: Select all
Deny from All
AuthType Basic
AuthUserFile /www/secure/.htpasswd
AuthName "Restricted Area"
Require valid-user
Satisfy any

The above configuration also assumes that the .htpasswd file will also be in that directory, but it can be elsewhere if you want.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 3049
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby Alanex » Sun Oct 05, 2008 4:28 pm

It's now working brilliantly so thank you for your help.

cheers,
Alan.
User avatar
Alanex
Newbie
 
Posts: 9
Joined: Sun Mar 30, 2003 5:32 pm
Location: Scotland


Return to 3rd Party Package Support for FREESCO v0.3.x

Who is online

Users browsing this forum: No registered users and 1 guest

cron