PDA

View Full Version : Some .htaccess help



HalfLifer
02-20-02, 08:47 PM
Can someone help me set this up with apache?

I put it in my htdocs dir, and used this:

AuthUserFile C:/Program Files/Apache Group/Apache/htdocs/.htpass
AuthGroupFile /dev/null
AuthName "Files"
AuthType Basic

require user files

AM I missing anything? It wont work :(

HalfLifer
02-20-02, 09:04 PM
bump

JamieLee2k
02-20-02, 09:11 PM
basically .htdocs is your root dir so when putting in the address don't put in .htdocs.

I maybe wrong but thats what I think you have to do.

I have apache and mysql installed on my laptop and thats what I had to do.

I installed VBulletin on my laptop so I can do testing and I had to take out .htdocs from the url.

Try it

HalfLifer
02-20-02, 09:16 PM
Did that, no worky.

JamieLee2k
02-20-02, 09:19 PM
all I can say is you don't need htdocs in the URL as that is your root DIR

JamieLee2k
02-20-02, 09:20 PM
did you put all your files you want to access in that folder

HalfLifer
02-20-02, 09:24 PM
Yes.

I fixed the stuff, but it still dont work.


Its all in htdocs.
Folders and files.

JamieLee2k
02-20-02, 09:33 PM
are you getting a page not found or an error

HalfLifer
02-21-02, 05:13 AM
Just doesnt ask for a user/pass.

Philip
02-21-02, 07:39 AM
In the apache configuration file, you have to enable the "AllowOverride" directive for .htaccess to be considered at all.

Also (for Linux) the syntax for the last line in .htaccess is "require valid-user" I believe. I'm not sure about Apache on Windows.

HalfLifer
02-21-02, 02:01 PM
thanks philip

Its lookin at the .htaccess now...but I get this in apache logs when I try to access it:

[Thu Feb 21 14:59:24 2002] [alert] [client 192.168.0.3] c:/program files/apache group/apache/htdocs/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")

ideas?

HalfLifer
02-21-02, 04:26 PM
anyone?

Stu
02-21-02, 10:03 PM
You need something like this in your .htaccess file:




AuthType Basic
AuthName "The message to display on the pop-up window"
AuthUserFile /path/to/passwd/file/passwd

require valid-user

HalfLifer
02-22-02, 03:59 PM
The stuff is right...its all in the htdocs folder, so I set it to just .htpasswd instead of /htdocs/whatever

Still dont work :(

BlueEP
02-23-02, 11:26 PM
Open up httpd.conf, and search for:


#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None Change it to AllowOverride All

Make the .htaccess like Stu said:


AuthType Basic
AuthName "description here"
AuthUserFile .htpasswd

require valid-userPut the .htaccess file in the directory you want locked, then make a .htpasswd file with the user / pass inside like:

files:password

Then place the .htpasswd in C:\Program Files\Apache Group\Apache -- not in htdocs. Restart Apache, and it should work fine, good luck.

HalfLifer
02-25-02, 03:29 PM
500 internal error

Still dont work.

BlueEP
02-25-02, 05:37 PM
:(

Works fine for me.