Solved

Premature end of script headers and 500 error on POST

Posted on 1998-10-01
11
217 Views
Last Modified: 2013-12-25
When I run my HTML form from a pc with Internet Explorer 4.0 installed, I get a 500 Error/Server Misconfigured. The access log contains a 401 Unauthorized error and then I get a Premature end of Script headers message in the error log.    The forms work when run on Netscape or the previous version of Internet Explorer.  The IE browser runs from a PC on a local area network.    The server, Apache 1.24b, is installed on a Dec Unix system.  The HTML forms, c and perl scripts execute on the Unix system.  The HTTP protocol for the IE is HTTP/1.1 and the HTTP protocol used by our version of Netscape is HTTP/1.0.  I believe that a protocol difference in HTTP/1.0 and 1.1 or a problem with the way the Internet Explorer authentication method is set up could be causing the problem because I have been able to run some forms even after receiving these messages.  Also forms using the POST request method are affected, but those with GET are still working.
0
Comment
Question by:dmh1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 

Author Comment

by:dmh1
ID: 1828910
Edited text of question
0
 

Author Comment

by:dmh1
ID: 1828911
Edited text of question
0
 
LVL 7

Expert Comment

by:faster
ID: 1828912
In http 1.1, the response header must contain Content-length, probably your cgi does not output it?
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 11

Expert Comment

by:mouatts
ID: 1828913
Assuming that Appache is using 1.0 then you can work around the problem by turning 1.1 off in IE. The option is under Internet Options/advanced/HTTP 1.1 settings.

This is not a bad idea at the moment because there are stil a lot of servers and proxies using 1.0 that get upset with 1.1 messages. In addition the earlier versions of IE4 do not actually output 1.1 even with these options checked.

Steve
0
 

Author Comment

by:dmh1
ID: 1828914
This is a workaround but doesn't really solve the problem.  And I don't know that it is a server problem.  However I do have additional information.  When I use the form, my userid and password in requested.  After entering the data, the access log contains a 401 error, and the error log, premature end of script headers.  If I use the back button, and resubmit the form (no
authentication requested) it works fine.  When I print the REQUEST_METHOD, immediately after the authentication is submitted the name/value pairs preceed the POST as part of the REQUEST_METHOD.  Example:
name=val&name2=val2&name3=val3&name4=POST
After going back and resubmitting the form (even though the 401 error is in the access log, the userid/password is not requested again), the REQUEST_METHOD is POST, as it should be.  
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1828915
If the problem is the HTTP version my workaround is in fact a solution. Nevertheless did you try it?

Alternatively if you accessing the HTML as the default page (ie index.html) of the domain some servers (I don't know about apache) treat this as different to when you specify the domain name and the file name from a security point of view. Such settings are worth checking. This is also true when a virtual directory is used that points to the root directory.


0
 

Author Comment

by:dmh1
ID: 1828916
Yes I did try your suggestion and it does work.  And you are correct in that it seems to be a problem with the http1.1 protocol.  This affects several forms and we have many users on the intranet and I prefer not to have them alter their settings but if it is necessary, so be it.    Also your suggestion pointed me back to the Apache error log (once I had run a cgi diagnostics script to get the environment variables set by the server) and Apache may have a workaround that I can put in one of the configuration files.  I intend to try that in the morning, although I haven't found a clear description of this particualar problem in their bug database.  We use server side includes, and when I printed the environment variables that were set by the server in my little debug script, the content_type, mime_type, and one other variable (I don't remember which one right now and I'm at home and can't check it)
had the values in there twice.  Like the strings were concatenated.  This was for the forms where the userid/passwd dialog box came up.  When I ran the forms again and the user/passwd dialog box didn't come up, the variables contained the single value or string.
Anyway you deserve the points for this because I feel much more comfortable that it is not a problem with my scripts.  After I try the test with the configuration file change, I'll put the results in the comments here for your info.  By the way, this is my first question in expert's exchange.  How do I accept your answer now?  Do you resubmit the answer or what?
0
 
LVL 11

Accepted Solution

by:
mouatts earned 120 total points
ID: 1828917
Yes I think I do have to resubmit a question and I believe that when you look at the question there is something at the bottom that alllows you too accept the answer. (I've yet to ask one so I'm not too sure). However if I'm wrong I think there is an answer in the customer service section.
0
 

Author Comment

by:dmh1
ID: 1828918
Actually, this problem occurs with MSIE4.01 and some other client applications which are supposed to be supporting http1.1.  Rather than have each user change the internet setting for http, Apache has a BrowserMatch statement which can be included in the httpd configuration file.  This is a better solution for us, because it requires no action on the part of the user community.  I found this problem documented in the Apache bug database but it took a while to know what to look for.
0
 

Expert Comment

by:basvannuland
ID: 2759374
nvbnbvnvbn
0
 

Expert Comment

by:basvannuland
ID: 2759381
im sorry, i thought this was a test case.
I have the problem right no, i get an error in Ie5 that it can't load tehe perl file, that's is.Now errornumbers what so ever.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question