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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Full path name

Status
Not open for further replies.

Oderbang

Technical User
Dec 18, 2005
8
GB
hi iv got apache 2 installed and running in httd.conf
AccessFileName .htaccess
AllowOverride All
this should mean the .htaccess file is working and it is

the problum im having is with the htaccess file n trying to find the full server path


contents of the .htacces file

AuthUserFile /password/.htpasswd
AuthName EnterPassword
AuthType Basic

require valid-user

iv run this script to find out what my full server path actually is

the script is:
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>

the return from the script is
C:/Program Files/Apache Group/Apache2/htdocs

but if i change my htaccess file to

AuthUserFile C:/Program Files/Apache Group/Apache2/htdocs
AuthName EnterPassword
AuthType Basic

require valid-user


it errors out with a server error 500
so how can i find my servers full path

the server service is runing localy on this computer so i cant just "contact my host" lol as im hosting it.
 
Hi

Oderbang said:
the problum im having is with the htaccess file n trying to find the full server path

[gray]# ...[/gray]

<?php echo $_SERVER['DOCUMENT_ROOT']; ?>
You did not read the documentation enough carefully.
mod_auth.html said:
File-path is the path to the user file. If it is not absolute (i.e., if it doesn't begin with a slash), it is treated as relative to the ServerRoot.

So is SERVER_ROOT, not DOCUMENT_ROOT. Look in your httpd.conf the value setted for that directive.

Regarding using full path, see the note about how Apache decides if a path is absolute : "f it doesn't begin with a slash". So try leaving out the drive from the path.

Feherke.
 
Apache doesn't like to see spaces in your paths. Put the path in quotes and see if that takes care of the problem.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top