Forum Moderators: phranque

Message Too Old, No Replies

Configuring password protection?

cant seem to get my hosting to password protect

         

BlueGhost

5:30 pm on Feb 20, 2006 (gmt 0)

10+ Year Member



Hello all, i've been using 1and1 hosting for about a month now, i got the developers package at $20 a month and it seemed like an amazing offer, 1,500GB transfer, 30gb webspace, and so on.

Well i am making a personal site for a business that only the employees can see, and i need to password protect it. The password protect feature that 1and1 offers doesnt let me change the username, and the username is so obscure i cant use it. Its like 038ad838fha-3 .

I have researched it on here and it looks like i have to use .htaccess and .htpasswd files in order to use a custom password and username. It looks really easy to install, but im having problems. Here is what i have in my htaccess file:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /password/.htpasswd
<Files index.html>
require valid-user
</Files>

in my directory, i have a folder named password where the.htpasswd file is located. After putting up the files in ascii format, nothing is happening to my page. I read somewhere i might need to restart the server, but i called 1and1 hosting (probably has the worst technical support in hosting) and they couldnt help me, and said they cant help with installing scripts, and also said with my package i cant restart the server.

I dont know what to do, and i need this done quickly. It needs to be pretty secure, because it has important documents on the site. Can anyone give me a hint at what im doing wrong?

coopster

7:10 pm on Feb 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



When using per-directory override files (.htaccess) it is not necessary to restart the server. Did you use the Apache htpasswd utility to create and edit the password file? Here is a must-read doc from Apache to get you on track:

[httpd.apache.org...]

BlueGhost

8:50 pm on Feb 20, 2006 (gmt 0)

10+ Year Member



thanks for the link, im reading it now. I think i might have a problem with where im putting the htaccess file. Right now, its in the main directory of my site, sitting besides css.css file and index.html . I have the password file in "/password/.htpasswd" . Am i doing this wrong?

Also, 1and1 developers package is very strange. Its basically like they gave me one big ftp, and i create folders in the ftp and point the domain at them. So, when i loginto the user of a certain domain, my root folder for that domain is nothing, just "/".

with that being said i am assuming that in the htaccess file i point:
AuthUserFile /password/.htpasswd

does that seem right? Thanks again!

coopster

9:44 pm on Feb 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Shared hosts are all different. However, I'm guessing that don't have a directory at the root level so '/password/' is not going to be a valid directory. There was a recent thread that discussed possible workarounds for shared hosts that don't allow directories other than your DocumentRoot. Perhaps this will help ...
[webmasterworld.com...]

If you don't know your DocumentRoot, there are a number of ways to find it, the quickest is to ask your provider ;-)