sureshxxx81 has asked for the wisdom of the Perl Monks concerning the following question:

I have installed Apache Server.but i cant get the file permission for CGI file within the cgi-bin folder file. And cgi-bin folder also not opened in brower. what is the problem.please explain clearly.because i am beginner for cgi file. i have installed Apache Http server 2.2

2006-01-13 Retitled by holli, as per Monastery guidelines
Original title: 'how to run cgi program'

Replies are listed 'Best First'.
Re: (OT) how to run cgi program
by ikegami (Patriarch) on Jan 13, 2006 at 17:42 UTC

    This is really not the site to help you configure your web server. But I'm sure you'll get some help if you do the following.

    First, start by reading Apache's CGI tutorial. Read it again if you already have. Try doing the examples.

    Then, if you still can't get it working, be more specific in describing your problem. Specifically, what error message are you getting, and what did you do that resulted in that error message. Don't you dare say "Internal Server Error" without giving us the appropriate entry in the error log file.

      Hee hee. When I first started writing CGI scripts in '97, it was a surprisingly long time before I learned how to actually log in to the *nix server and execute the script from the command line to see what the problem was. Later I learned to look through Apache's error log, and much later I learned to use CGI::Carp qw(fatalsToBrowser). I'm rather embarrassed to think of how much unnecessary pain I inflicted on myself. I used to visibly flinch when I would see that dreaded "Internal Server Error" screen. :)

Re: (OT) how to run cgi program
by ptum (Priest) on Jan 13, 2006 at 17:42 UTC

    Hmmmm. There are a number of things that can prevent you from invoking a CGI script from a browser. You'll probably need to give us more information.

    • Are you able to see the http://your.server.com/server-status page? Apache (if properly configured, started, etc., ought to give you a status page at that URL (assuming you have server-status turned on in your httpd.conf). If it doesn't, you may have problems with your Apache installation.
    • Is your cgi-bin directory ScriptAlias-ed, and does it have a <Directory> entry? If not, you'll need to edit your httpd.conf file accordingly and restart Apache.
    • Is the CGI script executable by the user that Apache is running under?
    • Is the CGI script printing the proper header information first, before it prints anything else?

    Just a few thoughts to get you started. Post a little more detail and you will probably be pleasantly surprised at how helpful this community can be.


    No good deed goes unpunished. -- (attributed to) Oscar Wilde