PDA

View Full Version : How do I find out...


iknowalttl
05-22-2005, 07:55 PM
I put in a script and can't access a certain area due to the need to put in the full path to the file... Is there an easy way to find out the full path on a server without waiting to ask the hosting support?

Lisa
05-22-2005, 08:12 PM
Hmm been a while since I did this but if memory serves me correctly...

If you have SSH/Telnet access to the server, you can login, cd to the directory in question and then type:

pwd

That should tell you the full path of where you are.

I'm sure one of the real tech gurus will shout me down if I'm wrong. :)

helix
05-22-2005, 08:17 PM
I think I understand. If it is a linux box you can use the whereis command.
ie:
whereis "filename"
with "filename" being the file you want to see the path for.

iknowalttl
05-22-2005, 08:21 PM
I don't have shell access

I need the part of the path that is before the cgi-bin directory which is in the root of my account

cd34
05-22-2005, 08:44 PM
#!/usr/bin/perl

print "Content-type: text/html\n\n";

open(PWD,'pwd|');
$pwd = join('',<PWD>);
$pwd =~ s/\n//gi;
close PWD;

print "Current working directory: $pwd
";

iknowalttl
05-22-2005, 08:48 PM
Originally posted by cd34@May 22 2005, 08:45 PM
#!/usr/bin/perl

print "Content-type: text/html\n\n";

open(PWD,'pwd|');
$pwd = join('',<PWD>);
$pwd =~ s/\n//gi;
close PWD;

print "Current working directory: $pwd
";
:huh: ... lost me... how do I need to be logged in to use those commands?

Hell Puppy
05-22-2005, 08:59 PM
Most FTP clients will let you run a "PWD".

FTP in, change to the directory in question and execute PWD via FTP.

in WS_FTP for instance it would be File->Operations->PWD

Cleo
05-22-2005, 09:06 PM
Create a file. Name it "info" without the quotes.

Put cd34's code in it.

Place this file in your cgi-bin.

Chmod it 755

Point your web browser to it, like this
http://terrizamore.com/cgi-bin/info

iknowalttl
05-22-2005, 09:06 PM
Originally posted by Hell Puppy@May 22 2005, 09:00 PM
Most FTP clients will let you run a "PWD".

FTP in, change to the directory in question and execute PWD via FTP.

in WS_FTP for instance it would be File->Operations->PWD
I tried that and only get results starting with the root of my account... if I am in my account root I get "/"... if I am in cgi-bin directory I get "/cgi-bin"

iknowalttl
05-22-2005, 09:12 PM
Originally posted by Cleo@May 22 2005, 09:07 PM
Create a file. Name it "info" without the quotes.

Put cd34's code in it.

Place this file in your cgi-bin.

Chmod it 755

Point your web browser to it, like this
http://terrizamore.com/cgi-bin/info
I get a server error... should I use an extention for the file and what extention should I use if it's needed

Cleo
05-22-2005, 09:16 PM
Did you chmod 755 it?

You can give it the extension of .cgi if your server needs it.

iknowalttl
05-22-2005, 09:19 PM
Originally posted by Cleo@May 22 2005, 09:17 PM
Did you chmod 755 it?

You can give it the extension of .cgi if your server needs it.
yes I chmod to 755...

added the extention and still get server error :(

Cleo
05-22-2005, 09:36 PM
Make sure that you have cd34's code exactly without any html tags, no body and head tags etc.

Maybe this isn't where Perl is located on your server.
#!/usr/bin/perl

Try
#!/usr/local/bin/perl

You can also try .pl for the extension.

iknowalttl
05-22-2005, 09:43 PM
Originally posted by Cleo@May 22 2005, 09:37 PM
Make sure that you have cd34's code exactly without any html tags, no body and head tags etc.

Maybe this isn't where Perl is located on your server.
#!/usr/bin/perl

You can also try .pl for the extension.
I did a copy and paste into note pad to create the file so it's the same... and looked it over... that is correct path for perl... tried the extention change and still no luck...

Inabon
05-22-2005, 09:45 PM
can you give us a url or ip so we can try to find out what kind of box is it? cause if perl did not work by default you may not have that enabled or you are on a windblows box (which i doubt)

iknowalttl
05-22-2005, 10:04 PM
Originally posted by Inabon@May 22 2005, 09:46 PM
can you give us a url or ip so we can try to find out what kind of box is it? cause if perl did not work by default you may not have that enabled or you are on a windblows box (which i doubt)
the URL is http://www.youngpicks.com and the cgi-bin directory is in the root... this is not a winblow box... and perl is PERL 5.005_02

Itchy
05-22-2005, 10:52 PM
http://www.adulttemplete.com/server.zip

this zip has a .cgi file setting to 777 in the cgi bin and then open it in a browser and the info is there

the php file can be used anywhere else

gonzo
05-22-2005, 10:58 PM
http://www.adultmegacash.com/resources.html

Itchy
05-22-2005, 11:09 PM
Done :)

Newton
05-22-2005, 11:13 PM
Originally posted by Itchy@May 22 2005, 07:10 PM
Done :)
Thanks and welcome back to Oprano ;)

Itchy
05-22-2005, 11:16 PM
Thanks I should have been more on the ball :)

iknowalttl
05-22-2005, 11:16 PM
Originally posted by Itchy@May 22 2005, 10:53 PM
http://www.adulttemplete.com/server.zip

this zip has a .cgi file setting to 777 in the cgi bin and then open it in a browser and the info is there

the php file can be used anywhere else
bum zip file

Itchy
05-23-2005, 12:18 AM
hummmmmmm just deleted and reloaded then downloaded and checked it should work now if not hit me up on icq and i'll mail them to you

iknowalttl
05-23-2005, 12:48 AM
Originally posted by Itchy@May 23 2005, 12:19 AM
hummmmmmm just deleted and reloaded then downloaded and checked it should work now if not hit me up on icq and i'll mail them to you
:okthumb: awesome.... thanks


nice script... :rokk: