Visit our sponsors!  
     
Latest update: March 18, 2001 9:10 PM
 
 

Sign Up

Web Forum

Search Engine

Link Exchanger

Top100

Hosted List

FAQ

Contact us

 

>>Perl CGI Scripts

Questions

  1. Where is the Perl executable?
  2. There's no cgi-bin directory?
  3. What file extension should my scripts have?
  4. What file permissions should my scripts have?
  5. Where is my base directory (Document Root)?
  6. What is the path for sendmail and date?
  7. My Perl Script isn't working! I keep getting Internal Server Error?
  8. Where can I get more information about Perl?
  9. Does the webservers support SSI?
 
Search For:

Login
user name:
password:
 
     
       
Answers
  1. Where is the Perl executable?
    The Perl executable can be found in: /usr/bin/perl

    The perl version is: 5.6.0
    [Back to top]

  2. There's no cgi-bin directory?
    The Free4Web.net webservers allow you to place your Perl scripts anywhere on your website. A common place to put them is in a directory called cgi-bin although this is not necessary.
    [Back to top]


  3. What file extension should my scripts have?
    The webserver recognises a Perl script by its file extension. Your Perl scripts should be in a file ending with: .pl or: .cgi
    [Back to top]


  4. What file permissions should my scripts have?
    The file permissions are set automatically by the webserver so manual settings of file permissions should not be needed.

    Perl scripts have their file permissions set to 700 or -rwx------.

    we simply suggest you chmod all files (including html files and data files) permissions set to 705 or -rwx---r-x, all of the files will be working fine and secure. No others can stolen your cgi script and data!

    Note, manually chmoding your scripts to make them group or world writable will result in your scripts failing to run properly.
    [Back to top]


  5. Where is my base directory (Document Root)?
    Each website has its own base directory. Where possible always use relative filename mappings. If you *must* use a full path please derive from the DOCUMENT_ROOT environment variable in your script. This will ensure that your website works reliably even if it is moved to a different directory by us.

    Here is a sample script which outputs your base directory.

    #!/usr/bin/perl

    print "Content-type: text/html\n\n";
    print "Document Root is: ";
    print $ENV{'DOCUMENT_ROOT'};


    Still don't know what is full path of your home directory? Nevermind, enter your URL here
    http://
    .
    [Back to top]


  6. What is the path for sendmail and date?
    The path for sendmail is: /usr/sbin/sendmail -t

    The path for date is: /bin/date

    Hint: If ever sendmail seems to not send mail, but you don't get an error message, check in your Free4Web.net mailbox - bounced messages will often end up there.
    [Back to top]


  7. My Perl Script isn't working! I keep getting Internal Server Error
    There are many reasons why you might get this error. You should check each of the following is okay:

    1) Have you uploaded the script in FTP ASCII mode
    2) Does your script start with the line: #!/usr/bin/perl?
    3) Does the script filename end in .pl or .cgi?
    4) Ensure the script is not writable by others.
    5) Ensure the directory the script is in is not writable by others.
    6) Does the script output the correct content type as the first line output? (eg: print "Content-type: text/html\n\n";)
    7) Has your base path been set correctly?

    If all these checks are okay then there is probably something wrong with the script. Please debug this in your own environment before placing on the Free4Web.net.
    [Back to top]


  8. Where can I get more information about Perl?
    A good point of reference is www.perl.com

    To understand how a Perl script is executed on the Free4Web.netf webservers take a look at the Apache suexec documentation.

    Some good places for free Perl scripts are: www.cgi-resources.com and www.hotscripts.com.
    [Back to top]


  9. Does the webservers support SSI?
    Sorry, this feature is only available to purchase service!

 
© 2000 Free4web.net all rights reserved.
Security | Privacy | FAQ.