Running Scripts on Your SiteTo 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:
This appears on the very first line of your Perl script. Put your scripts in public_html/cgi-bin https://yourdomain.com/cgi-bin/cgiwrap/username/scriptname.ext This must be the call for your particular script from the page that calls it. 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: ![]() Figure 1
Setting Permissions From The Command LineThe 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 ScriptYour 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.
|