Solved

CGI output breaks - aolserver 2.1 under Linux 2.0.29

Posted on 1997-06-19
6
266 Views
Last Modified: 2013-12-25
I have a running AOLServer on a Linux 2.0.29 kernel. I have set up CGI according to the manual, and my CGI-scripts are being executed (I can create files from them), but the HTML output never hits the browser.
Insted an error message is shown. The server.log gets two messages:

Error: Process 7935 exited from signal 13
Error: Error waiting for exit of CGI usr/aolserver/servers/cgi/hi.pl: Illegal seek

signal 13 = stdout pipe broken, I think.

The HTML output from the CGI-scripts is valid HTML, I've tried several sample scripts, as well as the simplest "hello world", starting with "Content-type: text/html\n\n" etc.

Today I got server-parsed html to correctly show the output from one of the scripts, so it is no fault of the shell or the script itself.

How do I get my CGI-script output to the browser?
0
Comment
Question by:hightower
[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
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:Philippe
ID: 1828392
Hightower,

There could be different causes to your problem. Did you test your cgi setup with a simple test script eg:

#!/bin/sh

cat <<EOF
Content-type: text/html

<html><body>
this is a test
</html></body>
EOF

My guess is that you have a problem with access rights. Are you aware that the scripts are executed by the server under a specif user id (typically 'nobody') and that 'nobody' may not have read or write permissions to most files or directories?

Anyway, tell us if the test script works at least and if it does show us your perl script. There is not enough info in your question to give an exact answer.

 cheers,

    Philippe

0
 

Author Comment

by:hightower
ID: 1828393
Phillipe,
as I stated in my original question I did try simple scripts. Now I have tried yours too. I modifyed it to:

#!/bin/sh
whoami > phil-user.txt
cat <<EOF
Content-type: text/html

<html><body>
this is a test
</html></body>
EOF

The file "phil-user.txt" is created, and the expected user appears in the file, when the script is executed, by accessing the correct URL, from the browser. The same old AOLServer error message appears in the browser window, so no output is getting through AOLServer from the script.

When I (same user as AOLServer use to run CGI scripts) run the script from the shell, the correct output appears on the screen.

Your script generates a new message in the server.log file:

Warning: CGI '/usr/aolserver/servers/server1/pages/devel/phil.cgi' returned non-zero exit status:  141


Conclusions:

1: My scripts gets executed when accessed by their URL, as stated  in the original question.

2: The output from the scripts does not get through AOLServer to the browser. Instead an AOLServer error message is sent to the browser.
0
 
LVL 2

Expert Comment

by:Philippe
ID: 1828394

> as I stated in my original question I did try simple scripts.

Sorry about that. I don't have much experience with AOLserver on linux (I use httpd from w3c). There is just one thing which is intriguing me. You said:

> Today I got server-parsed html to correctly show the output
> from one of the scripts, so it is no fault of the shell or
> the script itself.

Does this mean that don't usually have the output server-parsed? If you disable server parsing, your cgi will have to create a complete HTTP header and not just the content-type line. The simplest example would be

HTTP/1.0 200 OK
Content-type text/html

<html><body>hello world</body></html>

If I misunderstood you and the output is being server-parsed, then it must have to do with the server configuration and I don't think I can help you with aolserver.

 cheers,

   Philippe


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:hightower
ID: 1828395
Philippe,

> Does this mean that don't usually have the output server-parsed?

No, I was referring to a script called from an .shtml page (server-parsed html). The CGI output should (according to the AOLServer manual) automatically be prefixed with the data you suggested. I tryed including the suggested line, but the results were the same as ever.

I have been informed through the AOLSERVER mailing list that the error is due to a threading incompatibility between AOLServer and the version of the C-library I am using (libc 5.3.12).

Maybe I'll try to remedy this, or maybe I'll just wait for the next version of either software package. We'll see.

Thanks for your time.
0
 

Author Comment

by:hightower
ID: 1828396
I upgraded to libc 5.3.12-18, and my problem is solved!
0
 
LVL 7

Accepted Solution

by:
linda101698 earned 200 total points
ID: 1828397
I'm posting hightower's solution so the question can be graded.

From hightower:

I upgraded to libc 5.3.12-18, and my problem is solved!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

749 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