On 29 Jan 2000, titty jacob wrote:
> I can't run the cgi scripts. When I click the link to a cgi-script file the
> file as such is displayed. Is it any Apache problem or Config. problem. I
> wrote the script using perl , gave it the name something.cgi and saved it in
> the /home/httpd/cgi-bin directory. And then I gave a link in the html file to
> the script file. When I click on the link,
> the cgi script file as such is shown by the browser.
Are the files world executable and readable? They should have permissions
-rwxr-xr-x
otherwise they will not be executed.
Then, in /etc/httpd/conf (or the equivalent on your system) edit
access.conf and see if you have this sequence:
<Directory /home/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
order allow,deny
allow from all
</Directory>
That says that the cgi-bin directory has cgi exec rights and that everyone
can connect to it.
Then, in srm.conf, you must have this line:
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
That tells the server that /cgi-bin/ should map on to /home/httpd/cgi-bin/
Also, you should have:
AddHandler cgi-script .cgi
That tells the server that files with an extension .cgi are cgi programs.
You don't need this unless you are going to run cgi programs in a
directory other than /cgi-bin/
That's about it. Note that in your cgi-bin directory, files can have any
(or no) extension, but they must be world executable.
Also, try executing your program from the command line to see if it works
or not. How do you write cgi programs in perl? If you are not using
CGI.pm or cgi-lib.pl then you are going about it the wrong way.
Philip
To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the mailing list
button and fill the appropriate information
and submit. For any other queries contact the ML maintener