0

I can't find out which python environment is being used or install location is being used by mod_wsgi in Apache. In my apache config I didn't gave any specific venv config.

        ServerName 
        ServerAlias 
        DocumentRoot /home/Downloads

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        Alias /static /home/Downloads/static
        <Directory /home/Downloads/static>
                Require all granted
        </Directory>

        <Directory /home/Downloads/samples>
                Require all granted
        </Directory>

        <Directory /home/Downloads>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>

        #WSGIDaemonProcess group python-path=/home/Downloads python-home=/home/envlin
        WSGIProcessGroup group
        WSGIScriptAlias / /home/Downloads/wsgi.py

I removed the critical info and replaced with random info.

Here's my apache restart log

Apache Logs

Apache/2.4.46 (Ubuntu) OpenSSL/1.1.1j mod_wsgi/4.7.1 Python/3.9 configured -- resuming normal operations

Question

Is there any way to get which python version and install location is being used by mod_wsgi.

**Python Path's ** If I fetch python path's normally here's the result.

sys.path = [
    '/root',
    '/usr/lib/python39.zip',
    '/usr/lib/python3.9',
    '/usr/lib/python3.9/lib-dynload',
    '/usr/local/lib/python3.9/dist-packages',
    '/usr/lib/python3/dist-packages',
    '/usr/lib/python3.9/dist-packages',
]
4
  • 1
    You actually posted that information, didn't you? Commented Sep 28, 2021 at 9:12
  • but in these dist-packages, I can't find pip installed packages which I installed from requirements.txt. Just wanted to confirm If I can get which python mod_wsgi is using or the path of the python version. Commented Sep 28, 2021 at 9:19
  • How did you install those packages? Was a virtualenv active? Commented Sep 28, 2021 at 9:20
  • pip install -r requirements.txt Commented Sep 28, 2021 at 9:20

1 Answer 1

0

I didn't found the way directly to get mod_wsgi version, however I went in root directory as root user and ran a find command.

/home//Downloads/env/lib/python3.9/site-packages/allauth
/home//gmcwebenvlin/lib/python3.9/site-packages/allauth
/home//.local/lib/python3.9/site-packages/allauth

And tried changing variable in urls.py in all packages and worked in one.

It turn out even when we specify different config file for SSL version of website in Apache, Python home was picked up from the non-SSL version config still.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.