Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-26-2002, 07:11 PM   PM User | #1
Cei
New to the CF scene

 
Join Date: Jul 2002
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cei is an unknown quantity at this point
Finding full server paths

I'm trying to create a .htaccess/.htpasswd area on my website - but I don't know the full server path to my file - is there any way to discover this path, or will I have to contact my provider to make them give me the path?
Lastly, what does the "AuthGroupFile /dev/null" line do in the .htaccess file? Is it required?
Cei is offline   Reply With Quote
Old 07-26-2002, 11:55 PM   PM User | #2
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
Hi, to find any path on your server, just throw the script below in any directory (any directory that you can use CGIs in, that is), chmod it 755 and call it from your browser. It will show you the serverpath on your screen

Code:
 #!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<html><head></head><body>\n";
print "Your path is working and pointing to Perl version:<p>\n";
print "<B>$]</B><p>\n";
print "The complete path to this script is:<p>\n";
print "<B>$ENV{'SCRIPT_FILENAME'}</B><p>\n";
print "The relative URL of this script is:<p>\n";
print "<B>$ENV{'SCRIPT_NAME'}</B>\n";
print "</body></html>\n";
exit;
About the .htaccess; "AuthGroupFile /dev/null" is the filename containing a list of groups and the users they include. "Null" means it doesn't exist. Not sure if it is required.
MCookie is offline   Reply With Quote
Old 07-27-2002, 06:31 AM   PM User | #3
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Or you could use this ASP code:

<%=Server.MapPath%>
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 07-27-2002, 02:55 PM   PM User | #4
mouse
Regular Coder


 
Join Date: Jun 2002
Location: North East England
Posts: 853
Thanks: 0
Thanked 0 Times in 0 Posts
mouse is an unknown quantity at this point
Or this php:

<?=$DOCUMENT_ROOT;?>
__________________
[+] Computer/PC issues [+] Silverpaw3D
------------------------------------------------
Never buy a dwarf with learning disabilities...

...it's not big, and it's not clever.
mouse is offline   Reply With Quote
Old 08-14-2002, 04:01 AM   PM User | #5
SSJ2Gohan
New to the CF scene

 
Join Date: Aug 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
SSJ2Gohan is an unknown quantity at this point
I cant get that first perl option to work. Nothing shows up except exactly what is typed. Can anyone tell me how to properly write this in notepad or something like that?
SSJ2Gohan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:15 AM.


Advertisement
Log in to turn off these ads.