Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to guess absolute server path to htdocs

Status
Not open for further replies.

leehinkleman

Programmer
Feb 14, 2002
83
NZ
My friend S. Bowers is trying to use .htaccess and .htpasswd on a free hosting site, running on Debian. He needs to know the absolute path to .htpasswd, but the free host administrator ignores his requests for help. My command line ftp program in linux, with the pwd command, displays, as the path to his htm directory,
/sandrbowers.orcon.net.nz/htdocs

but using the path
AuthUserFile /sandrbowers.orcon.net.nz/htdocs/.htpasswd
fails, as do other guesses:
/home/sandrbowers/htdocs/.htpasswd
/var/
Is guessing the absolute path possible?
Thanks for your advice.
 
Try to make it write to a relative path file. The error message generated will probably contain the absolute pathname. Also, try a relative path for the .htaccess file.

The directory sandrbowers.orcon.net.nz is almost certainly in the path. Putting you in a chroot (change root) shell doesn't alter the name of the directory.

Finally, try writing a little cgi script that does a pwd. Sometimes they chroot ftp, but not the apache process.
 
Most of the time the .htpasswd files are hidden via server acls by default. Nobody wants the contents of these files
readily discoverable or readable by the world.

If you have an admin that won't allow read only access
to the .htpasswd file via a cgi script or some such arrangement locally than maybe you better reconsider the design of your web app or your hosting provider.

 
The free hosting site doesn't have PHP, nor Perl, with which I could determine the path. I did try just
AuthUserFile ./.htpasswd
as a guess at a relative path, but that line didn't work.
I've told my friend to change hosts if he wants to extend his website project.
Thanks for both of your answers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top