Welcome to WebmasterWorld Guest from 107.23.37.199

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

.htaccess - Authorization error

Can this be done?

     
8:13 pm on Dec 30, 2003 (gmt 0)

New User

10+ Year Member

joined:Dec 30, 2003
posts:2
votes: 0


My webhost tells me that the server is unix, but it's setup so I can't get below the directory tree on the server to find the .htpasswd file. the full path is home/"username"/html/"my website". is there anyway to right the AuthUserFile /.../cgi/.htpasswd so it doesn't have to start at the root of the server?

The tech also told me to write the .htaccess as if it is to run on a windows server? He said that the AuthUserFile is used differently on thatplatform? I'm very confused by that?
Everything I've seen is the format is the same?

Thanks

Tim D

9:55 pm on Dec 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Tim,

Welcome to WebmasterWorld [webmasterworld.com]!

Ugh... Weird server set up, plus the complexities of authorization -- together, they make for a tough job.

In this case, since you've apparently had contact with them, tell your host what file/subdirectory you want to password-protect, and tell them to do it. Not being rude to them, but the operative word here is "tell". You are the customer, and they have apparently opted to set things up strangely. You are the customer and they are the "hosting service provider". Therefore they should make you happy or watch you leave.

The path to the required .htpasswd file is specified as a local filepath from within .htaccess, so hopefully, they can tell you how to specify the correct path -- and how to correctly generate (add) usernames/passwords into that file in that directory.

Write .htaccess for Windows? Are you hosted on Apache running under Win2K or something? In that case, there might be a few differences related to the differing *file* naming conventions of *nix vs. Windows, but it shouldn't affect much beyond that. (This is a guess, since I have no idea what they really might have meant).

Jim

10:08 pm on Dec 30, 2003 (gmt 0)

New User

10+ Year Member

joined:Dec 30, 2003
posts:2
votes: 0


Thanks.

The host is running apache on unix. They said they didn't want people to be able to go into the directory tree, so they stop it at the file location of my webpage.

I'm going to tell them to try and put the password file (.htpasswd) on the server below my page and have them open up the connection so I can read and verify authorization from .htaccess.

Tim D

12:14 am on Dec 31, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Tim,

Rather than having it in the http-accessible space, you might want to ask them to put it in "username" or "username/html" -- as far up as it wil go while remaining accessible to you via local server pathname.

JIm

2:12 pm on Dec 31, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 16, 2000
posts:122
votes: 0


Ugh... Weird server set up, plus the complexities of authorization -- together, they make for a tough job.

IMHO clueless tech support from web host providers makes relatively easy tasks appear to be almost impossible. User authentication is not difficult.

My webhost tells me that the server is unix, but it's setup so I can't get below the directory tree on the server to find the .htpasswd file. the full path is home/"username"/html/"my website". is there anyway to right the AuthUserFile /.../cgi/.htpasswd so it doesn't have to start at the root of the server?

The AuthUserFile works from the / directory to your .htpasswd file
eg /home/username/.htpasswd

I'm going to tell them to try and put the password file (.htpasswd) on the server below my page and have them open up the connection so I can read and verify authorization from .htaccess.

There are several php and perl scripts that can be used for creating users with encrypted passwords and you can set up .htpasswd files within your own directory space with them. Visit www.hotscripts.com and type htpasswd in the search box and you will find several scripts.

[edited by: jdMorgan at 8:31 am (utc) on Jan. 1, 2004]
[edit reason] Edited at Gorufu's request [/edit]