Bug 209605 - 500 Internal Server Error in cgi is sent with text/plain content-type (DefaultType) instead of text/html
Summary: 500 Internal Server Error in cgi is sent with text/plain content-type (Defaul...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 7
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-06 12:02 UTC by Tomasz Ostrowski
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 2.2.6-1.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-18 22:32:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tomasz Ostrowski 2006-10-06 12:02:54 UTC
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 10:06:21 UTC
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 22:32:12 UTC
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.