I am trying to make a python flask app working in httpd 2.4 using mod_wsgi 4.6.2 (you can find details configuration here - my previous question). Anyway, when I tried to pass some configuration information into WSGI file or a python file. It was not successful. I assumed that I could do that because of this article.
<VirtualHost *:443>
........
WSGIDaemonProcess abcd_server user=python_user group=python_user threads=5 python-home="/var/www/m.abcd.com/venv"
WSGIProcessGroup abcd_server
WSGIScriptAlias / "/var/www/m.abcd.com/python-src/wsgi-src/abcd_server.wsgi"
SetEnv "P2SERVER_SRC" "/var/www/m.abcd.com/python-src/src"
SetEnv "P2SERVER_APP_CFG" "/var/www/m.abcd.com/conf/abcd_conf.yaml"
........
</VirtualHost>
I failed to retrieve P2SERVER_SRC using "os.environ['P2SERVER_SRC']" in the wsgi file and failed to retrieve P2SERVER_APP_CFG in a python file using "os.getenv" API. Of course that I could bypass these issues with hard coded values in the wsgi file. But I really like to make SetEnv working if possible.