Technical FAQ

General | FrontPage | PHP | CGI | E-Mail | Webstats | Miva E-Commerce | MySQL | RealAudio/Video < || > Online Manual

CGI-Scripts and Programming Languages

- What is the correct path to perl and other programs?
- Can I run scripts outside of my cgi-bin?
- How Should I set my file permissions on cgi-scripts?

- What version of Perl is installed?
- What Perl Modules are supported?
-
Why does my script produce an 500 Internal Server Error?
- Do you upgrade Perl when new releases are available?
- Can I compile programs written in C and C++?

 


Q: What is the correct path to perl and other programs?

A:

perl.........: /usr/bin/perl
sendmail.....: /usr/sbin/sendmail
date.........: /bin/date
python.......: /usr/bin/python
tcl..........: /usr/bin/tcl
OpenSSL......: /usr/bin/openssl

domain path..: /home/www/yourdomain
cgi-bin path.: /home/www/yourdomain/cgi-bin

If you are looking for other programs, just try "which programname" i.e "which perl"

Back to top


Q: Can I run scripts outside of my cgi-bin?

A: Yes, any script you setup outside of your cgi-bin must have a .cgi extension rather than .pl. If the file you are using has an extension other than .cgi and you would like to run it outside your cgi-bin you can just rename the file to *.cgi so it will execute properly.
If you really need the .pl extension outside your cgi-bin, you can add the following to your .htaccess file:
AddType application/x-httpd-cgi .pl
AddHandler cgi-script .pl

Back to top


Q: How Should I set my file permissions on cgi-scripts?

A:  Executed via the web by anyone: chmod 755
Executed by only yourself through the command line: 700

We run suEXEC seamlessly through the Apache web server.

This effects how file permissions are set. This automatically makes the rwxrwxrwx error when applied to file permissions. Perl scripts will never work if the permissions on the file are 777.

Files that would otherwise require world write access (guestbook pages) do not have to have this permission. Since the Perl script that will open and write to the file is executed under the owner's userid, and the file is also owned by the same user, then the file only needs to be writable by the owner, not the world.

Finally, there are some freeware or perhaps even commercial Perl scripts which may require you to set a directory to rwxrwxrwx (chmod 777). Again, this is not necessary. Setting the directory permissions to 755 should always be sufficient. If you do set any directories to rwxrwxrwx, then any Perl scripts located inside this directory will not execute.

Back to top


Q: What version of Perl is installed?

A: Currently we are using version 5.6.0

Back to top


Q: What Perl Modules are supported?

A: Any that are included with the normal Perl5 distribution plus the following:

Crypt-CBC
Crypt-DES
Crypt-SSLeay
DBI
Data-ShowTable
DateManip
Digest-MD5
GD
HTML-Parser
IO-stringy
MIME-Base64
MIME-tools
MailTools
Msql-Mysql-modules
Net_SSLeay.pm
URI
libnet
libwww-perl

Back to top


Q: Why does my script produce an 500 Internal Server Error?

A: This can have many causes, ranging from incorrect permissions to syntax errors within the script. Check that the script actually runs by running it from the shell account.
Then check permissions and ownership:

1. Does the main user of the domain own the script?
2. Do the script and its parent directory both have 755 permissions?
3. Was the script uploaded in ASCII mode, not binary?

Back to top


Q: Do you upgrade Perl when new releases are available?

A: Yes. Once a new build of Perl has been deemed as stable versus experimental, we will implement a upgrade across our network based on how it may effect existing scripts already in operation.

Back to top


Q: Can I compile programs written in C and C++?

A: Yes, we offer the gcc compiler.

The C and C++ compilers are integrated. Both process input files through one or more of four stages: preprocessing, compilation, assembly, and linking. Source filename suffixes identify the source language, but which name you use for the compiler governs default assumptions.

You can get further docs on the compiler when logged into shell by typing:

man gcc (hit enter)

Which will provide full syntax and options.

Back to top

 

- Last modified on 3/16/2003 -


Home / Hosting / Domain Lookup / Support / Email Contact

© 1998-2024 Spunkyworld Internet Services - All rights reserved