<rant>
Last June, I puzzled out how to get j602 to run for Apache users on
one of my web servers. Then I forgot what the trouble was and when I
recently wanted to move to j602 on my main server, I struggled for
several hours before figuring it out again.
Basically, the problem comes about because j602 wants to create a
folder (by default j602-user) in the user's home directory. This is
done early on in the profile.ijs script, in the lines:
home=. >(systype-5){(2!:5'HOME');(2!:5'USERPROFILE');'\My Documents'
userx=. '\j',('64-'#~16={:$3!:3[2),'602-user'
user=. home,userx
The problem is that because the "user" Apache doesn't have a home
directory or even the ability to login as a shell user, (2!:5'HOME')
returns a NUMERIC 0. Then the line trying to do home,userx gets a
domain error and that appears as quite a mysterious error in the
browser window calling the CGI... Is there some reason a numeric is
returned instead of a character string (or empty)?
One workaround is to modify profile.ijs to put a valid "home
directory" in the case where a 0 is returned. Another (and the one I
am using) does a
SetEnv HOME /tmp # or some other usable directory
in the /etc/httpd/conf/httpd.conf configuration file. I used to have
to put JPATH information into the Apache environment, and that
changed with each release - so j602 was a great step forward, but
does still require Apache knowing about it.
I think it would be worth noting this somewhere in documentation. The
best help that I got in tracking it down was from
http://www.jsoftware.com/help/user/start_errors.htm
and some reference there might help. The chase is made harder by
having to be isolated in a browser and its interpretation of the
results...
I suppose I should submit an article about my approach to CGI with J
... maybe this will motivate me to do that.
</rant>
- joey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm