Click to See Complete Forum and Search --> : CGI & Perl issues !
paddyhaig@yahoo.com
04-02-2002, 02:47 PM
I have a mountain of books here, have scoured the Internet and made piles of notes. Sent e-mails to RedHat who replied that the service I was asking for was outside of the service agreement. I just cannot seem to get any help setting up my Apache Web Server so that I can run cgi & perl scripts. Is there anybody out there that would take a look at my httpd.conf file and tell me if it is correct ?
furrycat
04-03-2002, 01:21 AM
Pay attention because although the advice I'm about to give may not seem helpful in this case (although then again it might) it WILL stand you in good stead when you use Apache in the future. Here goes:
When you have a problem with Apache - any problem at all - the VERY FIRST THING you do is check the error log. Only in rare circumstances will it fail to help you diagnose your difficulties.
Now, for CGI the most common way to run Perl scripts or any other scripts is to create a cgi-bin directory and tell Apache it's OK to run scripts from there.
Once you've made your cgi-bin and made it executable for the web server, add a line to httpd.conf something like:
ScriptAlias /cgi-bin/ /path/to/cgi-bin
That's it. There are security options you can add to the directory but the above is the bare minimum for scripts. If you do that you should be able to run your Perl scripts. Assuming your interpreter works, of course. Probably the simplest test script you can run is:
#!/bin/sh
echo "Content-type: text/plain"
echo
echo "Yeah I guess it works"
If the script is readable and executable for the webserver you should be in business. Then you can go and try to run a Perl script...