Forum Moderators: bakedjake
I am using Apache 2.0 on Linux Redhat Enterprise WS 4.
I want to be able to run cgi script from a web page. The script calls bash script which runs java code. Both jdk1.5 and java classes are under "/home/my_account/" and cgi script and bash script are in the default "/var/www/cgi-bin" directory.
I can run the script just fine as "root". Not as "apache (www)" though. If I try to run it within the browser, I get the following error message:
/home/my_account/downloads/jdk1.5.0_05/jre/bin/java: Permission denied
I have all permissions set to 755 (I have tried 777, but didn't help). It seems to me that "java" itself is the problem. For example, if I do
"cat /home/my_account/some_file"
instead of running java, that works fine.
I know it must have something to do with httpd.conf settings, but I just cannot figure it out.
Any suggestions? Thanks.
Who owns the Java install directory?
Have you tried changing ownership of the bin directory/files in question to "apache:root"?
There are several overlapping security issues going on, any of which could get you to that error, including ownership, permissions, and other stuff like not being able to bind to ports under 1023 without being root. Some of these depend on what the program is trying to do, although your problem seems to be simply getting access to the program file at this point.
If Java was un-tarred, config'd, make'd and make-installed as root, then only root can use it. If you did everything as a normal, unprivileged user except for the "make install", which needs to be done by root, then other unprivileged users (like apache) should be able to access the program.