Tech Support and FAQs Contact Us ServInt FreeNet Home


LOGO DOWNLOAD HERE

ServInt FreeNet is a service of
ServInt Internet Services.

Commonly-Asked CGI Script Questions


> Do you include access to CGI scripts for sites that
> you are hosting?

Yes.

> Do you have a formmail script for FreeNet users?

WE NO LONGER ALLOW USE OF FORMMAIL SCRIPTS BECAUSE THEY CAN EASILY
BE USED TO RELAY SPAM THROUGH THE SERVER

-------------------------------------------------------------

> Do you have provisions for CGI/BIN?  

Yes on both counts. For CGIs, we support Perl 5 and compiled C scripts
(optimized to BSD/OS 4.x or FreeBSD 3.x). 

-------------------------------------------------------------

> What CGI scripts are supported? (I'm only interested in providing them 
> with a form)

Any Perl or C CGI script should be fine.

-------------------------------------------------------------

> I finally found a guestbook, a wwwboard, and a forms script for our Freenet
> site.  I have designed the html for these but they all require that some code
> files be modified then go into the cgi-bin.  I can't seem to access a cgi-bin
> from my account.  I certainly hope you or one of the volunteers can help me.

We don't have CGI-BINs for freenet accounts, per se. By default, we allow
you to execute CGI scripts from anywhere within your account. However,
it's often nice to have a cgi-bin directory just for organizational
purposes, so I've taken the liberty of creating one in your account. 

For modifying your CGI scripts so they will run, there are a couple of
common things you might need to know:

* the path to Perl on the server is #!/usr/bin/perl
* you may need to reference your html directory, or one of its
subdirectories. Your html directory is located at
/usr/home/yourusername/public_html

-------------------------------------------------------------

> On http://www.XXXXXXX.org/other_chapters.html I have a link (the first one)
> that uses the redirect.cgi script found at
> http://www.technotrade.com/cgi/redirect.html. I installed it to our
> cgi-local directory, but it doesn't seem to work now, even though I've
> chmod'ed the files to 666. I get an Internal Server Error. Is Perl
> installed? I am sure there is something very simple I'm doing wrong, but
> wondered if you could look at it when you get a chance. Thanks in advance.
> Much appreciated!

I'm guessing that the problem is happening because any executable CGI
script should be chmod'ed 755 rather than 666. Let me know if this solves
the problem.

FOLLOWUP:

> I set it to 755 and got this error:
> 
> Internal Server Error
> The server encountered an internal error or misconfiguration and was unable
> to complete your request.
> Please contact the server administrator, wmdc01@dcfree.net and inform them
> of the time the error occurred, and anything you might have done that may
> have caused the error.
> 
> Premature end of script headers:
> /usr/home/XXXXXXX/public_html/cgi-local/redirect.cgi

The 'premature end of script headers' error means that the CGI started 
to execute and then didn't get far enough to provide a 'Location:' or
'Content Type: Text/HTML' header for the webserver. When I telnetted in
and ran:

dcfree:/usr/home/XXXXXXX/public_html/cgi-local# perl -c redirect.cgi

I got the following error:

Illegal character \015 (carriage return) at redirect.cgi line 13.
(Maybe you didn't strip carriage returns after a network transfer?)

I put a couple of hard returns in the file, and the syntax then checked
OK. I've also taken the liberty of adding a -w flag to the Perl invocation
at the beginning of the script, so you error logs should now provide more
verbose messages.

-------------------------------------------------------------

> The faq also mentions the possiblity of having an E-mail AutoResponder.
> We would like to have the ability let people request information or a visit.
> Is it possible to set up a request or feedback form that provides an email
> message back to the organizaitonal email account?

From what you're describing, you're looking for more a "feedback form" CGI
script than an autoresponder. See #4 below.

> Is it possible to incorporate pearl or cgi scripts in our site?

Yes! Perl scripts are certainly allowed. They can be executed from
anywhere within your public_html directory, or we can create a cgi-bin
directory for you if you'd like to keep them there for organizational
purposes. 

-------------------------------------------------------------

> can you install a cgi-bin on my site? (you can overwrite anything that
> is already there)
> where in my usr/home folder is the bin?

CGI execution is enabled from any directory; however, if you prefer to
put your CGIs in a cgi-bin directory for organization's sake, there is
already a cgi-bin directory there. Currently, its only contents are a file
caller counter.cgi.

The full path to the cgi-bin directory is:

/usr/home/XXXXXXX/public_html/cgi-bin

-------------------------------------------------------------
> 
> I have written a perl script that uses the Perl
> localtime function:
> 
> ($sec,$min,$hour,$mday,$mon,$year,$wday,
>  $yday,$isdst)=localtime(time);
> 
> I find that when I use it the day and year values
> are correct, the month is off by one (I get 7
> rather than 8) and the time is + 50 minutes from
> the true time.  Do you know why that might be?

Yes and no. Offhand, I'm not sure why the month is coming up short. I can
tell you that the "50 minutes" problem is caused by the server's clock
being 50 minutes off. Unfortunately, this can only be reset when the
server is in "single-user" mode (and thus not of much use to the outside
world). 

If I find out anything useful about the $mon problem, I'll let you know.

-------------------------------------------------------------

> I am trying to send email from within a CGI script.
> I would like to use the To:, From:, adn Subject lines
> >From what I've read it seems to me that this should work:
> 
> open (MAIL, "|mail -t") || &ErrorMessage;
> print MAIL "To: webmaster\@actorscenter.org\n";
> print MAIL "From: $from\n";
> print MAIL "Subject: Casting Profile\n";

Try putting an extra empty space after the subject (e.g., \n\n). I think
that needs to be there to be recognized. You also (although I'm not sure
why this would make a difference) may want to invoke mail -t as:

(MAIL, "|/usr/sbin/sendmail -t")

-------------------------------------------------------------

ServInt FreeNet Terms & Conditions * The ServInt FreeNet's Privacy Policy