I'm using Apache2 to deploy a django app, I've set apache2 to a different user then apache. The problem is that when the server runs the user changes but the home directory environment variabile($HOME) remains /root.Why is that ?
Asked
Active
Viewed 933 times
1 Answers
1
I'm not an expert with the internals of Linux/Unix, but I think the system call that changes the effective user ID doesn't change any environment variables.
Environment variables would only get involved if a new process was being exec()'d or spawn()'d, i.e., when you start Apache.
You can write a small wrapper script to set $HOME to another value, and then start Apache. If you are using Debian, you can just modify /etc/init.d/apache2.

ultrasawblade
- 161
- 2
-
ended up adding HOME=`cat /etc/passwd| grep $USER | cut -d ":" -f6` in /etc/init.d/httpd – John Retallack Sep 10 '10 at 13:37