View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0018241||CentOS-8||apache-commons-exec||public||2021-07-07 11:48||2021-07-15 12:59|
|Summary||0018241: No JAVA_HOME when executing as an apache user|
|Description||The problem occurs when trying to execute a cli java command as an apache user (from a php web app). It fails because apache user doesnt have JAVA_HOME set. Similar to a problem explained here https://www.reddit.com/r/CentOS/comments/gmay34/apache_httpd_24_and_centos_8_trouble_with/ . I tried adding an env var to a virtual host, and to bashrc, profile, and all the things I found that people suggested would solve the problem. When executing as a root user everything is fine, JAVA_HOME is as it should be and java commands work.|
|Steps To Reproduce||Execute any java cli command as an apache user while having JAVA_HOME set to a correct location.|
|Additional Information||This also happened on oracle linux server once, I also couldn't solve it.|
|Tags||No tags attached.|
|This is not a bug, it's standard behaviour. JAVA_HOME shoud be set on .profile or .bashprofile of each user that needs it. Some thing with other variables needed to run same software packages (Informix needs some specific variables)|
export PATH=$JAVA_HOME/bin:$PATH to both profile and bashrc but it doesnt work for apache user.
I edited the /etc/profile and /etc/bashrc files, I also editted httpd.service and some other configs for httpd without success.
Is there some other apache specific file that I missed?