View Issue Details

IDProjectCategoryView StatusLast Update
0018241CentOS-8apache-commons-execpublic2021-07-15 12:59
Reporterdanilo.sarovic Assigned To 
PrioritynormalSeveritymajorReproducibilitysometimes
Status newResolutionopen 
Summary0018241: No JAVA_HOME when executing as an apache user
DescriptionThe 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 ReproduceExecute any java cli command as an apache user while having JAVA_HOME set to a correct location.
Additional InformationThis also happened on oracle linux server once, I also couldn't solve it.
TagsNo tags attached.

Activities

atarallo

atarallo

2021-07-15 12:53

reporter   ~0038537

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)
danilo.sarovic

danilo.sarovic

2021-07-15 12:59

reporter   ~0038538

I added
 export JAVA_HOME="/usr/lib/jvm/jre-1.8.0-openjdk"

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?

Issue History

Date Modified Username Field Change
2021-07-07 11:48 danilo.sarovic New Issue
2021-07-15 12:53 atarallo Note Added: 0038537
2021-07-15 12:59 danilo.sarovic Note Added: 0038538