PDA

View Full Version : Password Protection


AngelaG
12-29-2004, 02:24 PM
Hi

I do a bit of freelance web design for friends and a couple of them want a password protected area on their site. I am trying to create a protected directory using .htaccess. However I am not sure how to find the full path for the following bit:
AuthUserFile public_html/membersarea/.htpasswd

As you can see I have from "public_html" but I am not sure how to find out what goes before that. :?:

Can anyone help me please.

Thank you
Angela

motorwatchercounter
12-29-2004, 03:11 PM
Hi AngelaG,

You need the full path to your directory. not wwwxxx.xxx/

If you have PHP create a php file with the following in.
<?php phpinfo(); ?>

ONE LINE. No PHP tags. save it as info.php and ftp it into your root directory. Using your browser type in
www.karateresource.com/info.php
This will give you a long list of PHP info. look for the heading
Apache Environment
next to DOCUMENT_ROOT you will see something like
/home/linuxxxx/m/xxx.net/user/htdocs
This is your real root so any further directoies will be
/home/linuxxxx/m/xxx.net/user/htdocs/next/next

Have a look at the following

http://www.he.net/faq/tutorials/htaccess/demo.html

I hope this helps.

EDIT - Don't forget to either remove this file or rename it after you have finished. Best is to rename it so only you can find it. It can always be used as a reference and contains other good info like sendmail paths etc.



:lol:

robinev
12-29-2004, 05:36 PM
Another less reliable solution might be to look at your ftp program. Many of them use (and display in a preferences area) the full server path.

If none of these suggestions work, you could try using a common Unix path which would be something like this for an account with the username "Foobar":
/u/f/foobar/public_html
The second directory name in that path is the first character of the account's username. The third directory is the username.

AngelaG
12-30-2004, 01:16 PM
Hi AngelaG,

You need the full path to your directory. not wwwxxx.xxx/

If you have PHP create a php file with the following in.
<?php phpinfo(); ?>

ONE LINE. No PHP tags. save it as info.php and ftp it into your root directory. Using your browser type in
www.karateresource.com/info.php
This will give you a long list of PHP info. look for the heading
Apache Environment
next to DOCUMENT_ROOT you will see something like
/home/linuxxxx/m/xxx.net/user/htdocs
This is your real root so any further directoies will be
/home/linuxxxx/m/xxx.net/user/htdocs/next/next

Have a look at the following

http://www.he.net/faq/tutorials/htaccess/demo.html

I hope this helps.

EDIT - Don't forget to either remove this file or rename it after you have finished. Best is to rename it so only you can find it. It can always be used as a reference and contains other good info like sendmail paths etc.



:lol:
Sorted! Brilliant!

Many thanks for your help!

Angela

AngelaG
02-28-2005, 09:41 AM
Hello

I have a similar sort of problem that has cropped up, for a different website I maintain.

I maintain a member's only website for my karate club and they want me to put the grading syllabus etc. up on the site, with a different username and password for each grade. Normally I would do this by creating ten different folders for each grade and then password protecting each folder using .htaccess and .htpasswd. However it is running on a Microsoft-IIS/5.0 server and I therefore can't get a .htaccess file to work. Short of telling the owners of the site to move to a provider that uses Apache can does anyone have any bright ideas on how to password protect 10 areas of a site, each with a different username and password (or even just a different Password with no username would do)?


Thanks in advance
Angela

motorwatchercounter
02-28-2005, 10:07 AM
http://www.troxo.com/products/iispassword/

It is free

:lol:

AngelaG
02-28-2005, 10:26 AM
http://www.troxo.com/products/iispassword/

It is free

:lol:

Brilliant!

Thanks :)

AngelaG
02-28-2005, 08:36 PM
Sorry - dimwit here!

When I have downloaded it and go to install the program it says that I have to install Microsoft IIS. Eh??? I don't think I can install it server side... I have no idea what I am supposed to be doing. Why oh why didn't I listen more in my lectures back when i was in University???

:(

webado
02-28-2005, 09:11 PM
That or something similar should already be available through your webhosting control panel.