[Home]   i n s t r u c t i o n s
< back to index       CGI Scripts
 
i n f o
   about us
   technical
   payment
   contact

s e r v i c e s
   packages
   server
   design
   sign up

s u p p o r t
   instructions
   F.A.Q.
   password

m i s c
   resellers
   offers
   free

h o m e

 

CGI scripts can be valuable tools to interact with visitors to your site. To get your scripts working, you will need to upload them in ASCII mode and set them to be executable (mode 700).

Some commonly needed information
  • Path to sendmail: /usr/lib/sendmail
  • Home directory: log in using ftp, and see where you start out. or, log in using telnet, and type "pwd"
  • Web root directory: (home directory)/www
  • cgi-bin directory: (home directory)/www/cgi-bin
  • PERL shell: /usr/local/bin/perl or /usr/bin/perl
Some common mistakes FTP mode Many FTP clients don't know that *.pl and *.cgi files should be uploaded in ASCII mode, and use binary instead. This results in a CGI that has an extra character (control-M) at the end of each line, and won't work.

Permissions If your CGI script's instructions tell you to set the mode of a file or directory to 777, don't do it. Their instructions incorrectly assume that your web server runs CGI insecurely, and needs these permissions to be set. If you set a directory or CGI script to mode 777, the web server will refuse to run it due to the insecure permissions you gave it (and tell you "500 internal server error").

Correct permissions
CGI scripts: 700 (secure) or 755 (publicly readable)
Data files: 600 (secure) or 644 (publicly readable)
Directories: 755
All other files: 644
Other useful information Filenames You can name a file *.cgi and put it anywhere inside your "www" directory and it will work. The cgi-bin directory forces anything inside to be treated as a CGI, regardless of filename. All HML files and pictures must be outside the cgi-bin directory.

Compilers The "c" compiler is gcc, the "c++" compiler is g++. A typical compile command is "gcc myprogram.c -o myprogram".

 

 
TOPICS
getting started
domain registration | mail forwarding | checking mail | uploading your site
basic features
web stats | hit counters | form-to-mail cgi | redirect cgi | autoresponders |
basic mailing lists | advanced mailing lists | search engine submission | frontpage extensions | password protected directory | custom error pages | subdomains
advanced features
cgi scripts | server-side includes | php | mysql |

 
All your hosting dreams come true!
P R O F E S S I O N A L
hkhosting.com
W E B   S E R V I C E S

Copyright © 1999-2003 HK Hosting Ltd. All rights reserved. Terms & Conditions