Questions:
- Can I use index.cgi as a default index (like index.html)
- Can I run CGI scripts in my home directory?
- I've got message "... declined due "Negative Record". What does it mean and how can I get rid of it?
- How do I run a perl program? I wrote a little program that reads one file, sorts it and writes to another Locally I just run the file in DOS. How can I do this on the server?
- I need an example of a WORKING cgi script, so that I can write my scripts correctly... HELP!
- It's saying I don't have permission to access #2
- It's saying I don't have permission to access...
- I am being getting a "File Not Found," or "No Such File or Directory." error.
- CGI Script Resources
Answers:
- Can I use index.cgi as a default index (like index.html)
Yes, you can.
- Can I run CGI scripts in my home directory?
yes, but you MUST call them .cgi
You cannot name them .pl or any other extension.
Dont forget to chmod 755
- I've got message "... declined due "Negative
Record". What does it mean and how can I get rid of it?
I have no idea... we would need WAY more info
than that :)
- How do I run a perl program? I wrote a little program that
reads one file, sorts it and writes to another Locally I just run
the file in DOS. How can I do this on the server?
The best thing to do is read our knowledgebase
article at:
http://x-mb/hilfe/31.html#5
That is an actual example of a working script that you can install
and run on your site.
You should use this as the basis for your work :)
- I need an example of a WORKING cgi script, so that I can
write my scripts correctly... HELP!
Ok, here is a basic cgi script written in PERL,
that if placed into your cgi-bin, and named test.cgi and if proper
permissions are set (chmod 755) (rwx rx rx), it will run. It also
must be uploaded in ascii.
#!/usr/local/bin/perl
print "Content-Type: text/html\n\n";
print "Hello world!\n";
- It's saying I don't have permission to access #2
This error message means that you are missing
your index.htm file. Note that files that start with a
"." are hidden files. To see them, type ls -al. If you
wish to FTP this file in, go to the home/yourdomain directory.
- It's saying I don't have permission to access...
IMPORTANT: CGI scripts MUST be
uploaded/downloaded in ASCII format. They must also be saved in
ASCII (text or .txt) format. This is very important. Failure to
follow these guidelines will result in an inoperable program.
- I am being getting a "File Not Found," or
"No Such File or Directory." error.
Upload your Perl or CGI script in ASCII mode, not
binary mode.
- CGI Script Resources
There are many good resources for CGI scripts
found on the web. The scripts at Matt's Script Archive found at
http://www.worldwidemart.com/scripts
are very good. Many of our scripts come from there. Another
excellent resource is The CGI Resource Index found at
http://www.cgi-perl.com/ Unless you are an expert on the subject,
you should look for scripts that are very well documented and come
with step-by-step instructions.
|