Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Souljas

macrumors regular
Original poster
Feb 4, 2004
127
0
Hi im just trying to get savvy with using perl scripts within my web page, however I have hit a brick wall. Im currently using a online guide http://webmonkey.wired.com/webmonkey/ . im currenly stuck on this page http://webmonkey.wired.com/webmonkey/99/26/index4a_page4.html?tw=programming.

i have managed to download a pre-made script and have posted it into the CGI bin and its all going ok. However im having problems with the top of the page where they start to talk about script permissions. Im not really sure what telnet is, and how to access it :( . If possible could anyone try and explain to me this page.

many thanks
Soul
 
telnet is a way to log into a remote computer. Usually it will be command line based using a shell environment such as bash, tcsh, csh, etc... (google these).

You can telnet to another machine using Terminal with the following command.

telnet -l <loginname> <servername|serverIP>

Fill in the appropriate login name and server name (or IP) above. Ex. telnet -l jking 123.45.67.89

If you are working locally, there is no need to telnet. Just open terminal and use those chmod commands.

Good luck
 
thanks, if im making a gusetbook (which i am) and attaching it to a website ( hosted by my isp) would that be local?
 
An example of telnet would be controling an iPod running Linux. For example, it's possible to get a distro of linux running on an iPod. You can even network it through the Firewire port (LANoE - LAN over Firewire). However, you can't control it fully, due to the lack of a keyboard. (And no, you cannot hook a keyboard into the USB port, because that is an upstream port, you need a downstream port. All you have is the scroll wheel, 5 buttons on the iPod, and the 5 buttons on the remote. If you consider rotating the scroll wheel, as pressing a button multiple times, this leaves you with an incredible 12 buttons! For controling a full version of Linux! Good for on the go, but for other things...)

So you log into it using telnet, and you get the Linux command prompt over a network.

This is really useful for running headless Linux servers, because you can control them from one terminal.

Telnet can also be used for logging into MUDs (Multi-user Dungeons/Dimensions) - MMORPGs, that are text based.
 
Souljas said:
thanks, if im making a gusetbook (which i am) and attaching it to a website ( hosted by my isp) would that be local?

nope. local = the computer sitting in front of you. (well, it's not quite that simple, but for your purposes all you need to know is that your ISP is remote, not local.) maybe the easiest thing for your needs would be to get a graphical FTP program such as Fetch or RBrowser; these will let you change file permissions on remote files in an environment that works much like the Finder, so you won't have to monkey with telnet.
 
thx guys, I used a ftp programme to access the cgi-bin, however i need to change the privilages, i need to something like this:

Once you see your guestbook.pl file there, you must change the permissions. Permission changing comes in two different forms: letters and numbers. Using chmod to change permissions can be confusing at first, but you don't need to grok the whole concept before you use it. The directions for your new CGI script will tell you what to do. You just need to know that the form for chmod is:

chmod [permission] [filename]

For example, the ReadMe file for my guestbook told me, "This file will need to be placed in the cgi-bin of your server and chmoded to a+rx." So I telnetted into the file where the script lives and typed:

chmod a+rx guestbook.pl

The chmod command is successful if you are returned back to the prompt without seeing an error message.


basically i can access my user area (using telnet and terminal). But because im a bit of a noob i dont actually know how to open the cgi-bin and get into the gusetbook.pl. Just wondering what do I have to do to get to the guestbook.pl file. thx

Soul
 
Sonofslim is right about using your FTP program instead of Telnet. Don't be too literal in your reading of the instructions. Your next step is really to change the file's permissions, you can do that from a command line using Telnet but you should be able to use FTP to do the same thing.

Maybe I can explain what you're trying to do in this step and why FTP can be used for it. "cgi-bin" is a directory (or folder) on your web server. Some servers, generally for security reasons, will only run web-accessible programs (like your guestbook) when their files are in the cgi-bin directory. On a Linux (or other UNIX type) system, the way you'd indicate that a file is a program is by changing its permissions to indicate that it can be run. That's why you want to both place guestbook.pl into the cgi-bin directory and change its permissions.

The command you have in the instructions:

chmod a+rx guestbook.pl

is used to do that. In this command the + indicates that you're adding a permission, the r means that you want the file to be accessible (readable) and the x means you want the server to treat it as a program (x is from "execute" as in "run" a program). So, once you have used this command, the server will understand that guestbook.pl is a program that you and other users may access and run.

Before using the command the server will probably think that guestbook.pl is just a text file. If you try to access it from a web browser, it may send you the file's contents or it may give you an error. I'm leaving out some detail, but that's the general idea. Your job now is to find a way to modify guestbook.pl's permissions to make it accessible and runnable. You could log in to the server using Telnet, assuming that your hosting provider even allows that, or you can use an FTP program to do the same thing.

Since you've already used FTP to get guestbook.pl into the remote cgi-bin directory, you already know how use FTP and how to "open" cgi-bin. What you want to do is this:

1. Use your ftp program to connect to your web server.
2. Find the cgi-bin directory and make sure that guestbook.pl is really in it.
3. If it is, then try right clicking on guestbook.pl (this step will be different depending on what FTP program you're using - you may have to use a menu option instead of right clicking). See if there's something like a Get Info command available. What you're looking for is a screen that will probably have a grid of 9 checkboxes that say something like "User", "Group" and "World" and "Read", "Write", "Execute". You want to place checks in the three "Read" checkboxes and the three "Execute" checkboxes. You also want to have the "Write" checkbox for "User" checked. (It's hard to be specific without knowing what FTP program your using but that's the basic idea.) Doing this will produce the exact same result as using the chmod command from Telnet.
4. Once you've done this, you should be able to move on to the next step in your Guestbook's instructions.

If you have trouble doing this, if you let us know what FTP program you're using, I'll bet someone here can tell you exactly how to do step 3 with it.
 
Grover said:
Sonofslim is right about using your FTP program instead of Telnet. Don't be too literal in your reading of the instructions. Your next step is really to change the file's permissions, you can do that from a command line using Telnet but you should be able to use FTP to do the same thing.

Maybe I can explain what you're trying to do in this step and why FTP can be used for it. "cgi-bin" is a directory (or folder) on your web server. Some servers, generally for security reasons, will only run web-accessible programs (like your guestbook) when their files are in the cgi-bin directory. On a Linux (or other UNIX type) system, the way you'd indicate that a file is a program is by changing its permissions to indicate that it can be run. That's why you want to both place guestbook.pl into the cgi-bin directory and change its permissions.

The command you have in the instructions:

chmod a+rx guestbook.pl

is used to do that. In this command the + indicates that you're adding a permission, the r means that you want the file to be accessible (readable) and the x means you want the server to treat it as a program (x is from "execute" as in "run" a program). So, once you have used this command, the server will understand that guestbook.pl is a program that you and other users may access and run.

Before using the command the server will probably think that guestbook.pl is just a text file. If you try to access it from a web browser, it may send you the file's contents or it may give you an error. I'm leaving out some detail, but that's the general idea. Your job now is to find a way to modify guestbook.pl's permissions to make it accessible and runnable. You could log in to the server using Telnet, assuming that your hosting provider even allows that, or you can use an FTP program to do the same thing.

Since you've already used FTP to get guestbook.pl into the remote cgi-bin directory, you already know how use FTP and how to "open" cgi-bin. What you want to do is this:

1. Use your ftp program to connect to your web server.
2. Find the cgi-bin directory and make sure that guestbook.pl is really in it.
3. If it is, then try right clicking on guestbook.pl (this step will be different depending on what FTP program you're using - you may have to use a menu option instead of right clicking). See if there's something like a Get Info command available. What you're looking for is a screen that will probably have a grid of 9 checkboxes that say something like "User", "Group" and "World" and "Read", "Write", "Execute". You want to place checks in the three "Read" checkboxes and the three "Execute" checkboxes. You also want to have the "Write" checkbox for "User" checked. (It's hard to be specific without knowing what FTP program your using but that's the basic idea.) Doing this will produce the exact same result as using the chmod command from Telnet.
4. Once you've done this, you should be able to move on to the next step in your Guestbook's instructions.

If you have trouble doing this, if you let us know what FTP program you're using, I'll bet someone here can tell you exactly how to do step 3 with it.

thanks, that was really heplful, it cleared it up for me (hopefully), BTW i think we are using the same FTP programme (Transmit). Thank god I didnt have to use telnet, far too hard for me :).

Many thanks all (esp grover :cool: )

Soul
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.