?
Solved

CGI output breaks - aolserver 2.1 under Linux 2.0.29

Posted on 1997-06-19
6
Medium Priority
?
268 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

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 800 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

762 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