[Jprogramming] CGI puzzle

Joey K Tuttle jkt at qued.com
Sun Jun 8 14:59:06 HKT 2008


Thank you Bill and Raul.

I finally remembered that in past versions of j I had to put a SetEnv 
statement in the Apache configuration file. In the past it was for 
JPATHjxxx, which was replaced (and new flexibility much appreciated) 
in j602. But, it seems that apache doesn't have a HOME environment 
variable set. That causes the line (in j602/bin/profile.ijs):

home=.    >(systype-5){(2!:5'HOME');(2!:5'USERPROFILE');'\My Documents'

to return numeric 0 for home, then in the subsequent lines:

userx=.   '\j',('64-'#~16={:$3!:3[2),'602-user'
user=.    home,userx

my domain error occurs in the second one... My solution was to add 
the following lines to /etc/httpd/conf/httpd.conf:

# a HOME for Apache to use j
SetEnv HOME /tmp

I suppose some changes in profile.ijs might avoid the need for 
changing Apache's configuration file. In any case, I'm happy having 
solved this.

- joey


At 02:05  +0800 2008/06/08, bill lam wrote:
>So does jconsole start up under apache's id "www-data", j602's 
>profile expects a directory at 2!:5 'HOME' of the current user that 
>user should be "www-data" in cgi.
>
>Joey K Tuttle wrote:
>>Which is why I decided to shorten the example, the catch block etc. 
>>was a red herring... stdout is the system default (1!:2&4) putting 
>>that in explicitly doesn't change anything - but being paranoid, I 
>>changed my last example to:
>>
>>#! /usr/local/lib/j602/bin/jconsole
>>(1!:2&4)  'Content-type: text/html',(10 10{a.), 'j602 says - Hello 
>>World!', 10 10 { a.
>>2!:55 ] 0
>>
>>and verified that 601 works while 602 fails....
>>
>>At 01:14  +0800 2008/06/08, bill lam wrote:
>>>I guess it raise error inside the catch block. And the catch block 
>>>is executed because there is error in the try block. Is the verb 
>>>stdout defined? Insert lines like
>>>(<'/tmp/err1') 1!:3~ LF,~ ": 4!:0 <'stdout'
>>>before the try block to confirm verbs/nouns are defined.
>>>
>>>HTH
>>>


More information about the Programming mailing list