Solved

CGI output breaks - aolserver 2.1 under Linux 2.0.29

Posted on 1997-06-19
6
260 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now