LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   apache2 and 500 (https://www.linuxquestions.org/questions/debian-26/apache2-and-500-a-555173/)

rblampain 05-19-2007 12:05 PM

apache2 and 500
 
I have recently installed Debian Etch and since I always had problems understanding Apache, I decided to include a few lines, as described below, in /etc/apache2.conf because I need different configurations depending on the testing work I do. I followed the recommendations I found in "Teach Yourself Apache2 in 24 hours."

These are the lines I recently used after setting up user and group and setting up the document root as /home/nasm in the "default" file in "sites-available".

In the directory /home/nasm/ I have a .cgi assembly routine that Apache finds but I keep getting a 500 error, sometimes complaining about a premature end of headers although they were rendering in a previous phase of the testing (before I installed Etch).

I access this script through a short HTML form, as required.

What I would like to know is if the lines below are correct, especially the uncommented lines, and sufficient for Apache to work.

I have also read someone putting the scripts in /usr/lib/cgi-bin/ and solving a problem that way. Should I consider that? I have no "alias" in the apache2.conf file.

Any hint most welcome.

Thank you for your help.

# #####################
# # Allow PHP scripts #
# #####################
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

# To use CGI scripts outside /cgi-bin/:
#
AddHandler cgi-script .cgi

# ##################################
# # Allow execution of .cgi files #
# ##################################
<Files *.cgi>
Options +ExecCGI
SetHandler cgi-script
</Files>

# ####################################
# # Allow CGI execution in /cgi-bin/ #
# ####################################
#<Location "/cgi-bin/">
#Options +ExecCGI
#SetHandler cgi-script
#</Location>

# ################################################
# # Allow CGI execution in directory '~/scripts' #
# ################################################
# <Directory "/usr/local/apache2/scripts">
# Options +ExecCGI
# </Directory>

Dutch Master 05-19-2007 04:10 PM

What does the 500 error say? Or better, what error does error 500 stand for?

rblampain 05-20-2007 12:44 AM

Sometimes the only indication is the logs saying "Premature end of headers", while some other time the message is that there is an error in the config files. The result is not always the same, the server seems to think for a while before giving its diagnosis.

The definition of the code 500 is "Internal Server Error : Server config setting or an external program has caused an error."

This seems to indicate that the problem could be anything, this is why I am hoping to have my additions to the config files checked by experts.

The issuing of the headers worked properly before I expanded the program, so I doubt very much this could be the cause.

If there is nothing obviously incorrect or missing in my config files, I will have to test by trial and error until the bug is exposed.

rblampain 05-20-2007 03:11 AM

I have found my program is buggy, it looks for an environment variable that does not necessarily exist and has no provision to deal with its inexistence.

It looks like my Apache config files are OK but it would be good to have comments from the experts because I am still uncertain they are absolutely correct.


All times are GMT -5. The time now is 11:22 PM.