Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: How do apache environment variables get set at startup? |
|
Author |
|
Shaggy1
Joined: 30 Jul 2020 Posts: 11
|
Posted: Mon 30 Jan '23 19:01 Post subject: How do apache environment variables get set at startup? |
|
|
System Info
Code: | $ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
$ uname -a
Linux lb-cam-bca-fs 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ apachectl -v
Server version: Apache/2.4.6 (CentOS)
Server built: Mar 24 2022 14:57:57 |
Hi
I have been playing with wsgi on my apache 2.4 server and have noticed that the environment variables I am seeing in apache do not seem to be inherited from the shell in which I start apache - which is what I expected.
I initially put this query out on linux questions - see https://www.linuxquestions.org/questions/linux-software-2/how-can-i-debug-resolve-inconsistencies-in-wsgi-python-environment-4175721339/, but thus far have not been pointed to an explanation, so was wondering if anyone on this forum knew anything about how the environment variables are determined at runtime.
I run apache from the command line like this:
And the httpd processes are run as apache user, which is a nologin user.
Does anyone know how the environment variables are determined when I do this (I have specifically been looking at PATH and PYTHONPATH) ?
As noted in the above link I can explicitly set these in /etc/sysconfig/httpd, but I would like to understand where the defaults are coming from. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|