gwhite has asked for the wisdom of the Perl Monks concerning the following question:

My client has an AIX I-Planet server. I have a couple of CGI applications I have installed and am trying to get to perform predictably. In the first CGI script I output a simple form for data collection, using the modules CGI and Text::Template and the form displays fine. Upon submitting the form (via post) a second script, also using CGI and Text::Template does a couple of calculations and returns the results. Except I-Planet is producing a set of headers prior to my CGI output. So you get the rendered HTML preceeded by the header produced by CGI. When I take out the header producing code everything renders properly, except the CGI header was setting a cookie and setting the expires parameter. I have tried using -nph=>1 in the header statement and removing it. From this second form I have another CGI that can be executed, (this time with a get), that does not set any header flags, but fails in the same way as the second form.

So I can type in a cgi url and it works, but every CGI called as either the result of a submit or a link fails with this header issue. My other application is much larger and complex and before moving onto it, I need to get this resolved.

This definitely could be an AIX I-Planet configuration issue, but my guess is that there may be a monk who has run into this very thing and has a clever solution.

thanks for any insight...

before you ask what the code looks like

print $output->header(-cookie=>$cookie, -expires=>'now' ),$html

this code runs as is on 50+ Apache & IIS servers

g_White

Replies are listed 'Best First'.
Re: AIX I-Planet and CGI Headers
by dragonchild (Archbishop) on May 11, 2005 at 15:39 UTC
    IPlanet (aka SunOne) is notorious for doing exactly what you're seeing. It's purely an IPlanet issue and has nothing to do with your CGI code. You will need to talk to the sysadmin in charge of the IPlanet configuration.

    • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
    • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"
Re: AIX I-Planet and CGI Headers
by jhourcle (Prior) on May 11, 2005 at 15:47 UTC

    You're close on the nph track -- but you need to tell iPlanet that you're using it. (-nph=>1 tells the CGI module that it needs to generate the extra headers, but it doesn't have a way to pass that back up to the webserver).

    The easiest way is to start the name of the script with 'nph-', but it's possible that there are other ways these days. (I haven't managed the Netscape/iPlanet/SunOne line of servers for a couple of years now)

    Sun makes it hard to directly link to documentation sections, so you'll want to go to http://docs.sun.com/app/docs/prod/sunone, then click on 'Web Server', and then your version number.

      Any idea of what the configuration variable might be? Gone through a few of the books trying educated guessing and nothing has been right so far.

      g_White

        Nope. But I know I've done something before. I might've just moved the files, and used NameTrans, though.

        (and I don't have access to those systems to check the configuration.)

        Read the programmer's guide for your version of iPlanet. search for 'nph' in your configs, etc. You might find something that you can abuse. It might've been something that was passed as options into something. The programmer's guide should have a chapter (appendix?) with the things that you can do with obj.conf

        If you, the contractor, are configuring the webserver, then just install Apache and go from there. If they don't have anything that requires cookies (or other script-side header stuff), then they won't notice the difference.

        If they do, cargo-cult their code and get the job done.


        • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
        • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"