Running scripts
This section covers CGI scripts, program paths, viewing installed Perl modules, explaining permission settings, PHP scripts, and accessing phpMyAdmin.
CGI scripts
All CGI scripts must be placed in your cgi-bin directory. The cgi-bin folder is in your public_html directory (e.g. public_html/cgi-bin). If you want to run a CGI script in a subdomain, put the script in the cgi-bin directory of the subdomain.
To learn more about directory structure, click here.
Loading CGI scripts
When using FTP, script files (such as .cgi and .pl) must be uploaded in ASCII mode. FTP, binary or “auto”. If “auto” is selected, make sure that the .cgi and .pl files are considered ASCII files by your FTP client. The scripts will not run in binary mode.
Be sure to follow the instructions that come with the CGI script.
To learn more about uploading files to your server, click here.
Software Pathways
Paths that scripts usually use.
Path to pearl: /usr/bin/pearl
Path to sendmail: /usr/sbin/sendmail
CGI URL: http://www.example.com/cgi-bin/script.cgi
CGI subdomain URL: http://subdomain.example.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 do not work, it is possible that your hoster has installed your account in a different directory than /home. Contact him to get the right ways.
Viewing installed Perl modules
In the main menu of the Control Panel, click the System and Files icon, then the Perl Modules icon.
The figure below shows an example of a Perl module list cutout. If a CGI script requires a particular perl module, check this list to make sure the module is installed on the server.
Access rights
File permissions determine who can read, write and execute files, such as scripts. When the installation instructions ask you for the CHMOD file, you will be asked to set permissions for the file. File permissions can be changed with most popular FTP clients or through the control panel’s built-in file manager.
Some common permission levels for files:
600 Makes the file inaccessible
644 Readable to all (e.g., HTML documents)
666 File can be read and changed (e.g. for HTML files modified by scripts)
755 File can be read and executed by any user (e.g. for scripts)
777 Written and performed by all (not recommended)
Most scripts must be set to 755. Refer to the script documentation for proper installation instructions.
To learn more about file permissions, click here.
PHP scripts
PHP scripts are fully supported on all servers running DirectAdmin Web Control Panel. PHP scripts can also be placed and executed in any folder in your public_html directory. Refer to the script documentation for the correct file resolution and installation procedure.
Access to phpMyAdmin
To access phpMyAdmin, log in to the control panel and click on the “Accounts” icon, then the link “Manage MySQL”, then the link “phpMyAdmin” at the top of the table.
phpMyAdmin is a tool written in PHP that allows you to administer your MySQL databases. You can perform SQL operations, work with fields (add, edit, delete), work with tables (create, modify, delete), create additional databases and much more. Keep in mind that phpMyAdmin is intended for experienced users.
You can find more information on how to use phpMyAdmin here.