Am trying to setup my django application (virtual environment) using apache and mod_wsgi. the application is running on RHEL8 machine and the only python running is python 3.
RHEL version == Red Hat Enterprise Linux release 8.2 (Ootpa)
python version == Python 3.6.8.
apache version == Apache/2.4.37 (Red Hat Enterprise Linux).
mod_wsgi version == 4.7.1.
django version == 3.1.
My Python virtual environment home is: python-home using sys.prefix
i have created the mod_wsgi.so using CMMI method. below is the library detail
ldd mod_wsgi.so details
below is my virtual host conf file for apache. i have also tried adding python-path (like below), although not written in conf file details below.
WSGIDaemonProcess sohail python-home=/home/ilearn/webapps/sohail python-path=/home/ilearn/webapps/sohail/src
webapptest.conf:
<VirtualHost *:80>
WSGIScriptAlias /webapptest /home/ilearn/webapps/sohail/src/webapptraining/wsgi.py
WSGIDaemonProcess sohail python-home=/home/ilearn/webapps/sohail
WSGIProcessGroup sohail
WSGIApplicationGroup %{GLOBAL}
<Directory /home/ilearn/webapps/sohail/src/webapptraining>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
As soon as i startup my apache server i see the error ModuleNotFoundError: No module named 'encodings'
in error logs.
[core:notice] [pid 4576:tid 139861315184960] AH00052: child pid 4893 exit signal Aborted (6)
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
appreciate any help or advise to resolve the problem.
thanks.