Home >> Running Scripts

Running Scripts

 

This section covers CGI scripts, program paths, viewing installed Perl modules, understanding permissions, PHP scripts, and accessing phpMyAdmin.

 

CGI Scripts 

All CGI scripts must be placed in your cgi-bin directory.  The cgi-bin folder is located in your public_html directory (e.g. public_html/cgi-bin).  If you want to run CGI script in a subdomain, put the script the subdomain's cgi-bin directory.

 

Uploading CGI Scripts

 

When using FTP, it is very important to upload script files (e.g. .cgi and .pl) in ASCII mode.  FTP clients will give you the option of uploading in ASCII, binary, or "auto."  If "auto" is selected, then make sure .cgi and .pl are considered ASCII files by your FTP client.  Scripts will not execute properly if they are uploaded in binary mode.

 

Be sure to follow the directions included with the CGI script.

 

Program Paths 

The following paths are commonly needed by scripts.

 

Path to perl:               /usr/bin/perl

Path to sendmail:       /usr/sbin/sendmail

 

CGI URL:                   http://www.yourdomain.com/cgi-bin/script.cgi

Subdomain CGI URL:  http://subdomain.yourdomain.com/cgi-bin/script.cgi

 

Path to cgi-bin:                       /home/username/domains/domain.com/public_html/cgi-bin

Path to cgi-bin (subdomain):    /home/username/domains/domain.com/public_html/subdomain/cgi-bin

 

Important:  

 

If these paths don't work, it is possible that your host has installed your account on somewhere other than /home.  Please contact them to get the correct paths.

 

Viewing Installed Perl Modules 

From the main control panel menu click the "Advanced Tools" icon, then the "Installed Perl Modules" icon.

 

 

The above picture is a sample cutout of the perl modules list.  If a CGI script requires a specific perl module, check with this list to confirm that the module is installed on the server.

 

Understanding Permissions 

File permissions define who can read, write, and execute files such as scripts.  When the installation instructions ask you to CHMOD a file, you are being asked to set file permissions.  File permissions can by modified by most popular FTP clients or through the control panel's built-in file manager.

 

Some common permission levels for files are:

 

600  Makes a file inaccessible

644  Readable by everyone (e.g. HTML documents)

666  File can be read and modified 

755  File can be read and executed by everyone 

777  Writable and executable by everyone (use with caution)

 

Most CGI scripts need to be set to 755.  Please refer to the script's documentation for proper installation instructions.

 

PHP Scripts 

PHP scripts are fully supported on all servers running DirectAdmin Web Control Panel.  PHP scripts may be placed and executed in any folder within your public_html directory.  Please refer to the script's documentation for proper file permission and install procedures.

 

One of the best resources for locating PHP scripts is at: http://www.hotscripts.com

 

Accessing phpMyAdmin

 

phpMyAdmin is a tool written in PHP that allows you to administrate your MySQL databases.  You can execute SQL statements, work with fields (add, edit, delete), work with tables (create, alter, drop), create additional databases, and much more.  phpMyAdmin is intended for advanced users.  Most PHP scripts will automatically setup the database for you, so you probably won't need to use phpMyAdmin..

 

phpMyAdmin can be accessed at http://www.yourdomain.com/phpMyAdmin.  Please visit http://www.phpmyadmin.net for more information on using phpMyAdmin.

 

Need more help?

 

Please contact your hosting company for more assistance, or visit the DirectAdmin support forum at http://www.directadmin.com/forum.

 

 


© 2003 JBMC Software. DirectAdmin licensees may reproduce this page for their own customers.  Reproduction by other parties is prohibited.