Solved

CGI output breaks - aolserver 2.1 under Linux 2.0.29

Posted on 1997-06-19
6
264 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Nmap how to find wich type of socks is this? 4 98
Fixed div within Bootstrap carousel item 11 59
User profile Size Report 3 73
.php tree directory? 5 73
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
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.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

809 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