.htaccess & .htpasswd

  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

Im still encountering problems while using these two to secure a map with a password.

Im using this in the .htaccess:

Code: [ Select ]
AuthName "Please enter the password and loginname to enter."
AuthType Basic
AuthUserFile .htpasswd
AuthGroupFile /dev/null

Require valid-user
  1. AuthName "Please enter the password and loginname to enter."
  2. AuthType Basic
  3. AuthUserFile .htpasswd
  4. AuthGroupFile /dev/null
  5. Require valid-user


I've used some other alternatives too, all same result.
The .htpasswd looks like this:

Code: [ Select ]
teamskope:63wWH7jnBdKAE


I've used http://www.euronet.nl/~arnow/htpasswd/ to encrypt the password, which is "example".

It won't let me through, as if the password is incorrect.
I did upload both files as .txt in ASCII.

And, yeah, I know i should put the .htpasswd in another map outside the www, but 1st thing is i made it this simple to make sure the fault isnt in the path of the location of .htpasswd, and second, im using lycos as a host, and it doesnt have a "www" map. Instead, you're directly at the web.

Ive also tried doing it on another host, http://www.onehost.ws, where it says they support password secured files, but whenever I change the file to .htaccess/.htpasswd, it disappears. And when i name it .htaccess/.htpasswd before uploading, it doesnt show there either.

Id be really glad if someone'd knew a way out. Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

as far as I know, you need to put the COMPLETE path to the .htaccess file, and you're best storing it somewhere OUTSIDE of the public web directory tree.

Usually I put my files here..

/home/user/.htpasswd
/home/user/public_html/.htaccess (or whatever the directory is that I want to protect).

then I have "AuthUserFile /home/user/.htpasswd" in the .htaccess.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Oh, just make sure .htpasswd is chmod'd so Apache has access to read it :)
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

To keep your files from disappearing when you upload/rename them make sure your ftp client is set to show hidden files. If your ftp client doesn't have a setting for this, try FileZilla. The option is under Edit > Settings > Remote File List in FileZilla.

Not all hosts support showing hidden files, but if they allow the use of .htaccess they should. I know some of the free ones like GeoCities don't, and won't let you connect if your ftp client is set to show them.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Oh, and if you have shell (telnet/ssh) access (specifically bash)... add this to your ~/.bash_profile at the bottom...

alias ls='ls -aF --color=always'

Just helps those directory listings show up nicer & neater, and the "-a" bit shows all hidden files (Those starting with a ".")
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

Axe wrote:
Oh, just make sure .htpasswd is chmod'd so Apache has access to read it :)


i have it modded to 644, read all, write owner. Would it require more?
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

Ill try filezilla, but no i dont use shells
thanks
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

Axe wrote:
as far as I know, you need to put the COMPLETE path to the .htaccess file.


Errr...i doubt i have to put the .htaccess path in the .htaccess.
That a typo or?
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

I meant complete path to the .htpasswd :)
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

oh well, i have it in the same folder, just for testing.
theres no not-on-the-www-folder on tripod.

Anyways, I tried FileZilla, and it showed the files, but its just that that host isnt available for me anymore.

Does anyone know if this is not supported by lycos?
And, most important, does anyone know what there might be wrong in what i do?
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

I'm going to make a guess that tripod doesn't support this.

Most free hosters don't allow things like this. They do free hosting, make their money from advertising. If it's password protected, nobody's going to see it, which means it's useless as advertising space, so it would be a bad business decision for them to allow this.
  • Inito
  • Graduate
  • Graduate
  • User avatar
  • Posts: 223

Post 3+ Months Ago

yeah thats probably the good guess, i tried it on another host and it worked. thanks
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Hey, I know this is an older post, but you may still be able to help me. I am having pretty much the same problem, but no matter what I do, It wont allow me to login. I get the password prompt, but when I type the password it wont it wont accept it. I tried everything you guys suggested and I still get nothing. I put my files in the smae place Axe put his, same code, still nothing. The other thing Im not sure off is whether my server is Windows or Unix. I use rackshack in case you are wondering. What am I doin wrong or what do I need to do to fix this. Its important I get this done as the project is for a client. Thanks Guys!!

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 157 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.