. . .for the best web experience
CGI - FAQ •
Connection Settings Common Questions Upload a Web Page
CGI Scripts FAQ Dial-up Numbers Setting up a Counter
Connection Stats Helpful Links Helpful Software
DSL Troubleshooting Spam Filtering  

This page should contain all the information you'll need to run a CGI script on BestWeb's server. Please note that BestWeb does not provide technical assistance on the setup, troubleshooting, or operation of CGI scripts. Any non-system related problem will fall under our standard consulting fee ($75.00 per hour).

Basic Settings
Perl (version 5) /usr/local/bin/perl
Perl (version 4) /usr/local/bin/perl4
sh (shell) /bin/sh
sendmail /usr/sbin/sendmail

New as of 07/30/2001:

Please note, the following changes have been made:

  • All files in your website that are viewable to the public reside on ftp.bestweb.net.
  • Files on shell.bestweb.net are not public.
  • Changes made in files on shell.bestweb.net will not be seen by the public.
  • Changes made in files on shell.bestweb.net will only be useful for testing purposes.
  • ftp.bestweb.net is only able to be accessed through an ftp client.
  • BestWeb will not move files from shell.bestweb.net to ftp.bestweb.net or vice versa. You will need to do that.
This means a few things. Whereas shell.bestweb.net was formerly used to set the proper permissions for CGI scripts, that must now be done in your FTP client while logged into ftp.bestweb.net. Changing permissions for files in shell.bestweb.net will have no effect on those files in your website. It will only be useful for testing if your programs work.

General Guidelines

  • Make sure all your scripts end in .cgi
  • Make sure the permissions are set correctly for both the script and the directory using the command chmod 755 [script] from your shell.
  • Make sure the first line of your script points to the Perl interpreter using the syntax #!/usr/local/bin/perl
  • If you encounter an Internal Server Error try running the script from your shell to see what errors exist. Make sure to include a './' in front of the script name.
  • Make sure to save your scripts in UNIX format. Many Windows or Macintosh editors will insert ^M control characters after each line causing the script not to work.

Frequently Asked Questions

Can I set up CGI scripts on BestWeb's server?
What do I need to do to make the script work?
Permissions? How do I set those?
I used to change the permissions of my CGI scripts in shell.bestweb.net, but that doesn't work anymore. How do I do it now?
I try to access my script and my browser tells me "Method Not Supported. Why?
I try to access my script and I get a Server Error. Why?
How do I execute the script to test it?
I try to execute the script and I get "command not found".
I need the location for certain programs on your server. What are they?
I don't know how to write a CGI script. Can you guys help me?
Can I run Server Side Includes?

Can I set up CGI scripts on BestWeb's server?

Yes you can. BestWeb allows our users to place CGI scripts within their HTML directory.

What do I need to do to make the script work?

You need to make sure the script ends with a ".cgi" extension. Other extensions, like ".html" or ".pl" won't work.

You also need to make sure the permissions are correct. The script will not execute correctly unless the script is executable by all and only writeable by yourself. Nor will it work if the directory is writeable by either group or other.

I used to change the permissions of my CGI scripts in shell.bestweb.net, but that doesn't work anymore. How do I do it now?

Permissions can now be set with your ftp client in ftp.bestweb.net. If you would like a shell account to test your CGI scripts, you can e-mail systems@bestweb.net and you will be set up with shell access in a business day.

Permissions? How do I set those?

In Windows, in the WS_FTP ftp client, you can right click on a file and choose 'chmod (UNIX)'. This will bring a window up where you can change all of the appropriate permissions.

I try to access my script and my browser tells me "Method Not Supported. Why?

You need to make sure that the filename ends with ".cgi".

I try to access my script and I get a Server Error. Why?

First, make sure that the permissions on your script are set correctly. See question #3 for details.

Another possibility is that your script is not correctly outputting a "Content-type" header. The first thing your script prints out needs to be a line like this:

Content-Type: text/html

Followed by a blank line. If your script doesn't print this, you will see the server error.

Perhaps your script is *supposed* to print out the "Content-type" header, but an error is preventing it from working correctly. You can try running your script from the command line in the UNIX shell to verify that the script is printing correct information.

How do I execute the script to test it?

Telnet to shell.bestweb.net and use the following commands:

cd public_html
./(name of your script).cgi

While you are in the shell, you can use the following command:

pico (name of your script).cgi

to edit the script. Once you are done testing and editing, type:

exit

to exit the UNIX prompt.

I try to execute the script and I get "command not found".

This usually happens because the #! line at the start of your script is incorrect. The correct locations for various programs are listed in question #9 below.

If the location looks correct, it's possible that the script has a strange character at the end of the line that is confusing UNIX. Make sure you upload your file in ASCII (text) mode rather than binary mode. This strips off the strange characters and helps UNIX out.

I need the location for certain programs on your server. What are they?

Perl (version 5) : /usr/local/bin/perl
Perl (version 4) : /usr/local/bin/perl4
Sh (shell) : /bin/sh
Sendmail : /usr/sbin/sendmail

I don't know how to write a CGI script. Can you guys help me?

BestWeb does not provide assistance with CGI scripts for standard dial-up accounts. If you would like us to write or correct your scripts, we can help you at our consulting rate ($75 / hour).

You can however find a useful reference guide at http://web.fwi.com/quadzilla/links/cfm/cgilinks.cfm

Can I run Server Side Includes?

Yes. All you need to do is have your web page file name end in .shtml instead of .html, and use the proper SSI syntax to load the script (<!--#exec cgi="yourscript.cgi"-->)

WebGuide Search WebMail Local Directory Assistance Users BestWeb Home

Question about your service or need technical support? Click Here
Or,
Give us a call at 1-877-777-BWEB

Question about the site or this page on this site?
E-mail: webmaster@bestweb.net

BestWeb Corporation 25 South Riverside Avenue Croton-on-Hudson, NY 10520 • Customer Support E-mail:support@bestweb.net • Phone 1-877-777-BWEB • Fax (914) 271-4292 Copyright 1999 BestWeb Corporation - All rights reserved.