<div dir="ltr"><div>Solved.</div><div><br></div><div>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 <a href="http://wien2k.at" target="_blank">wien2k.at</a> 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.</div>
<div><br></div><div> So, to wrap up this thread:</div><div>* w2web works on my Mac</div><div>* thank you to Gavin Abo and Stefan Loffler for looking at the source with me and sending many insightful suggestions.</div><div>
<br></div><div><br></div><div>Sorry for the confusion.</div><div><br></div><div><br></div><div>Cheers,</div><div><br></div><div>Kevin</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 12, 2014 at 3:01 PM, Kevin Jorissen <span dir="ltr"><<a href="mailto:kevinjorissenpdx@gmail.com" target="_blank">kevinjorissenpdx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>Hi Stefan,</div><div><br></div><div>Thanks very much for taking the time to write such a detailed reply. I appreciate it very much. </div><div><br></div><div>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. </div>
<div><br></div><div>My own guess was slightly different -- that when I type <a href="http://local" target="_blank">http://local</a> host:7890 w2web opens <a href="http://index.pl" target="_blank">index.pl</a> (as it is programmed to look for index files when you point it to a directory, in this case the root directory htdocs) - and <a href="http://index.pl" target="_blank">index.pl</a> 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. </div>
<div><br></div><div>Note that some of the pages execute fine, e.g. Surfing to <a href="http://localhost:7890/session/new.cgiworks" target="_blank">http://localhost:7890/session/new.cgiworks</a> fine (or is it <a href="http://new.pl" target="_blank">new.pl</a>? 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 ...)</div>
<div><br></div><div>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. </div><div><br></div><div>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. </div>
<div><br></div><div>(I'm also failing so far to compile wien2k-13/lapw0 correctly on Mac, but that will be for a new discussion.)</div><div><br></div><div><br></div><div>Cheers</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div><br></div><div>Kevin</div></font></span><div><div class="h5"><div><br></div><div><br>On Aug 12, 2014, at 6:55 AM, Stefan Löffler <<a href="mailto:stefan.loeffler@tuwien.ac.at" target="_blank">stefan.loeffler@tuwien.ac.at</a>> wrote:<br>
<br></div><blockquote type="cite"><div>
<div>Hi,<br>
<br>
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.<br>
<br>
Am 2014-08-08 um 07:47 schrieb Kevin Jorissen:<br>
</div>
<blockquote type="cite">
<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px"></span>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.
<div style="font-family:arial,sans-serif;font-size:13px"><br>
</div>
<div style="font-family:arial,sans-serif;font-size:13px">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).</div>
</div>
</blockquote>
<br>
No, the problem seems to be somewhere before that. In bin/w2web,
lines 590-600, it seems that change.cgi is executed.<br>
<br>
In lines 614-628, the output is read. According to the HTTP standard
(<a href="http://tools.ietf.org/html/rfc2616#section-4" target="_blank">http://tools.ietf.org/html/rfc2616#section-4</a>), 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).<br>
<br>
The header fields are normally written by the PrintPage function in
libs/<a href="http://w2web.pl" target="_blank">w2web.pl</a>. 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).<br>
<br>
PrintPage, in turn, is called at the end of
htdocs/session/change.cgi.<br>
<br>
<br>
My suggestion:<br>
First, put the following line just before the "Missing header" line
in bin/w2web:<br>
while($line = <CGIOUTr>) { &write_data($line); }<br>
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).<br>
<br>
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.<br>
<br>
HTH<br>
Stefan<br>
<br>
<div>-- <br>
<pre style="margin:inherit">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-13899
<a href="http://tinyurl.com/njcu47" target="_blank">http://tinyurl.com/njcu47</a> DVR: 0005886
</pre>
</div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><div class=""><br><span>Wien mailing list</span><br><span><a href="mailto:Wien@zeus.theochem.tuwien.ac.at" target="_blank">Wien@zeus.theochem.tuwien.ac.at</a></span><br>
<span><a href="http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien" target="_blank">http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien</a></span><br><span>SEARCH the MAILING-LIST at: <a href="http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html" target="_blank">http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html</a></span><br>
</div></div></blockquote></div></blockquote></div><br></div>