[Wien] Does w2web work on Mac OS X?
Kevin Jorissen
kevinjorissenpdx at gmail.com
Wed Aug 13 01:02:39 CEST 2014
Solved.
After understanding the role of the PrintPage statements in the code, I
reached a surprising and embarrassing conclusion- my copy of SRC_w2web is
simply broken. I downloaded a fresh copy of SRC_w2web.tar.gz from wien2k.at
and discovered that change.cgi was truncated in my local version, compared
to the fresh version. I have no explanation for how that happened -- an
editor crashed at a bad time? copy failure when files get synced between
machines? too many wien2k versions on my computer? -- but a fresh install
of the w2web source cured all the problems. w2web is working now.
So, to wrap up this thread:
* w2web works on my Mac
* thank you to Gavin Abo and Stefan Loffler for looking at the source with
me and sending many insightful suggestions.
Sorry for the confusion.
Cheers,
Kevin
On Tue, Aug 12, 2014 at 3:01 PM, Kevin Jorissen <kevinjorissenpdx at gmail.com>
wrote:
> Hi Stefan,
>
> Thanks very much for taking the time to write such a detailed reply. I
> appreciate it very much.
>
> I've indeed tested the lines coming back from CGIoutr and they're empty as
> you suspected. The html headers simply aren't being written.
>
> My own guess was slightly different -- that when I type http://local
> host:7890 w2web opens index.pl (as it is programmed to look for index
> files when you point it to a directory, in this case the root directory
> htdocs) - and index.pl points to change.cgi through redurectURL (in
> lib/w2web). My hypothesis has been that redirectURL ought to write the
> header lines, and it's not happening for some reason. I had ignored
> PrintPage - I assumed it only prints content? - but it seems that according
> to you, this also prints a header? I'll look at the problem again using
> the pointers you've provided and let you know of any updates.
>
> Note that some of the pages execute fine, e.g. Surfing to
> http://localhost:7890/session/new.cgiworks fine (or is it new.pl? I
> forget) and by being clever I can do some of the w2web tasks, but too many
> don't execute right (change session, execute program ...)
>
> I've tried running the server through Komodo to do step by step debugging
> but again my primitive knowledge of perl/cgi prevents me from succeeding.
>
> My 2 Mac machines have a similar software configuration, so if anyone with
> a Mac can confirm it's working for them, that would be very valuable.
>
> (I'm also failing so far to compile wien2k-13/lapw0 correctly on Mac, but
> that will be for a new discussion.)
>
>
> Cheers
>
>
> Kevin
>
>
> On Aug 12, 2014, at 6:55 AM, Stefan Löffler <stefan.loeffler at tuwien.ac.at>
> wrote:
>
> Hi,
>
> I neither have a Mac, nor am I a Perl expert. But I assume that it should
> work, being a bunch of perl scripts. Here are some pointers/suggestions.
>
> Am 2014-08-08 um 07:47 schrieb Kevin Jorissen:
>
> When I do so, the configuration stage passes without problems; I can enter
> my login/password; I am then forwarded to (e.g.)
> localhost:7890/session/change.cgi but this page does not display - I only
> see "Error - Missing Header" in my browser.
>
> I can see which lines of the perl code in $WIENROOT/SRC_w2web/bin/w2web
> throw that error, but I don't understand enough perl to troubleshoot
> properly. (I noticed there's some manipulation of line endings in the
> preceding perl lines, but I don't think they're responsible).
>
>
> No, the problem seems to be somewhere before that. In bin/w2web, lines
> 590-600, it seems that change.cgi is executed.
>
> In lines 614-628, the output is read. According to the HTTP standard (
> http://tools.ietf.org/html/rfc2616#section-4), this should consist of
> Headers, followed by an empty line. w2web parses the header fields and
> stops if (a) there are header fields followed by an empty line or (b) there
> are no header fields, but two empty lines. Then, the header fields are
> checked. In your case, w2web stumbles over a missing Content-type field
> (though most likely there are no header fields at all, or maybe even no
> message at all).
>
> The header fields are normally written by the PrintPage function in libs/
> w2web.pl. The only reason it might fail (assuming it is called at all)
> seems to be if it can't open the HTML template htdocs/template.html. In all
> other cases, it should write the Content-type header, followed by by two
> new-lines (and followed by the page of interest).
>
> PrintPage, in turn, is called at the end of htdocs/session/change.cgi.
>
>
> My suggestion:
> First, put the following line just before the "Missing header" line in
> bin/w2web:
> while($line = <CGIOUTr>) { &write_data($line); }
> That way, you should be able to see what comes out of change.cgi.
> Presumably, there is no output (except for the missing header error).
>
> Additionally, check if change.cgi is called (e.g., by putting the line
> 'PrintPage("Change SID", "OK");' in the beginning, or by writing something
> to a log file, or...). If it's not called, there may be something wrong
> with the forking. If it is called, there is some problem in change.cgi that
> needs to be tracked down in more detail.
>
> HTH
> Stefan
>
> --
>
> Stefan Löffler USTEM
> Vienna University of Technology T: +43 1 58801-45226
> Wiedner Hauptstraße 8-10/E052 / A-1040 Wien F: +43 1 58801-13899http://tinyurl.com/njcu47 DVR: 0005886
>
> _______________________________________________
>
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
> SEARCH the MAILING-LIST at:
> http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20140812/572bbd8a/attachment.htm>
More information about the Wien
mailing list