Running Scripts on Your Site

To add interactivity to your site, you might want to implement scripts (shell, C, or Perl) on your site. Many scripts are freely available throughout the Web and through other resources. However, there are several parameters which need to be set to enable the scripts to run.

Most of these scripts come with extensive documentation. The documentation describes the configuration certain lines in the script itself to enable it to work on your particular host machine, and often needs to know the location of certain programs on the server. The following information will be required:

  • Location of Perl:
  • /usr/bin/perl
    This appears on the very first line of your Perl script.

  • Location of sendmail:
  • /usr/bin/sendmail

  • Upload location:

  • Put your scripts in public_html/cgi-bin

  • Call for script:

    This must be the call for your particular script from the page that calls it.

  • Setting Permissions

  • Once your script is uploaded, it must be set so you can run it. There are different ways of achieving this. If you are using an FTP program such as WS_FTP, select the uploaded file, and right click it. Then select chmod UNIX from the menu, and then a dialog box will pop up with permissions. Click the checkboxes to select permissions as shown in Figure 1:
    WS_FTP Chmod Dialog Box
    Figure 1

  • Owner:
  • That is you. You want to be able to read, write, and execute this script.

  • Group:
  • In UNIX, the group is traditionally users you share files with. On the Web, this is anyone who is visiting your site. You don't want them to be able to write to your script, but they should be able to read and execute the script.

  • Other:
  • In UNIX, this is 'the rest of the world.' They, too, should not be able to write to the script, but should be able to read and execute it.

Setting Permissions From The Command Line

The other way to set permissions (chmod) is to log into your shell account, go into the directory your Perl script is in (public_html/cgi-bin) and then type the following:
chmod 755 scriptname.ext

Other Files Associated With Your Script

Your script might write to an actual page on your site. If that is the case, you will need to set permissions to that particular file so everyone can write to it, as well as read and execute it. Most well-documented scripts will tell you which files to chmod and the parameters. A word to the wise: Not all scripts are well-documented. If you are having trouble getting a script to run, check your permissions and determine if the script is writing to another file, and whether or not you have chmod'ed that file.

Again, in WS_FTP, right click on the uploaded file, select CHMOD (UNIX) and click the appropriate checkboxes in the dialog box.

Why Us?


Follow Us


All Rights Reserved
© Copyright 2018

Customer Support   855-TDL-HOST (855-835-4678)    -     TDL Solutions    -    Webmail