Bug 209605 - 500 Internal Server Error in cgi is sent with text/plain content-type (DefaultType) instead of text/html
500 Internal Server Error in cgi is sent with text/plain content-type (Defaul...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
7
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-06 08:02 EDT by Tomasz Ostrowski
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 2.2.6-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-18 18:32:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Tomasz Ostrowski 2006-10-06 08:02:54 EDT
An error page "500 Internal Server Error" caused by bad CGI script
is sent with content-type text/plain by default
(or other content-type which is determined by DefaultType option
in httpd.conf).

Version-Release number of selected component (if applicable):
httpd-2.2.2-1.2

How reproducible:
Always

Steps to Reproduce:
1. Setup a httpd server with default configuration
2. echo "echo test" > /var/www/cgi-bin/test.cgi
3. chmod a+x /var/www/cgi-bin/test.cgi
4. lynx http://localhost/cgi-bin/test.cgi

Actual results:
   Alert!: HTTP/1.1 500 Internal Server Error

   <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>500 Internal Server Error</title>
   </head><body>
   <h1>Internal Server Error</h1>
   <p>The server encountered an internal error or
   misconfiguration and was unable to complete
   your request.</p>
   <p>Please contact the server administrator,
   root@localhost and inform them of the time the error occurred,
   and anything you might have done that may have
   caused the error.</p>
   <p>More information about this error may be available
   in the server error log.</p>
   <hr>
   <address>Apache/2.2.2 (Fedora) Server at localhost Port 80</address>
   </body></html>


Expected results:
   Alert!: HTTP/1.1 500 Internal Server Error

                   Internal Server Error

   The server encountered an internal error or misconfiguration
   and was unable to complete your request.

   Please contact the server administrator, root@localhost
   and inform them of the time the error occurred,
   and anything you might have done that may have caused the error.

   More information about this error may be available
   in the server error log.

   Apache/2.2.2 (Fedora) Server at localhost Port 80


Additional info:

If DefaultType is "text/html" then this error page is sent with this
content-type, which happens to be correct. But this is not a good
choice for DefaultType.

I've tried to set DefaultType and ForceType for
<Directory /var/www/error> and <Location /error/> and uncomment
   ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
but it did not work.
Comment 1 Tomasz Ostrowski 2007-07-20 06:06:21 EDT
Retested on:
httpd-2.2.4-4.1.fc7 (Fedora 7)
httpd-2.2.3-7.el5.centos (CentOS5, so also RedHat5)
Both still affected.
Comment 2 Fedora Update System 2007-09-18 18:32:12 EDT
httpd-2.2.6-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.