skip to Main Content

I am facing issue in running the server(Site can’t be reached) after python upgrade from 2.x to 3.7.2
Our server config:

  • Mac OS 10.13.6 (High Sierra)
  • Apache 2.4.33 custom installation
  • Python 3.7.2 (Brew install python3)
  • Django 2.1.5 (Installed via pip inside python 3 env)
  • mod_wsgi 4.6.5 (Installed via pip inside python 3 env)

I have added the following two lines(mod_wsgi-express module-config) in httpd.conf file removing the python 2.7 references:


LoadModule wsgi_module "/../MASP_ENV3/lib/python3.7/site-packages/mod_wsgi/server/mod_wsgi-py37.cpython-37m-darwin.so"
 
WSGIPythonHome "/../MASP_ENV3" 


Also in httpd-vhosts.conf:


WSGIDaemonProcess mysite.com processes=2 threads=15 display-name=%{GROUP} python-home=/Library/WebServer/Documents/MASP_ENV3 python-path=/Library/WebServer/Documents/mysite

WSGIProcessGroup mysite.com
WSGIScriptAlias / /Library/WebServer/Documents/mysite/wsgi.py

After restarting the server, when we hit the URL in the browser the page continues to load for a while(2-5 mins) and later displays “Site can’t be reached”

It would be great if one can guide me with valuable suggestions. Thanks!

2

Answers


  1. Chosen as BEST ANSWER

    The problem was the virtual env not created in the python3 system installation directory. I fixed the issue by following this doc:
    * https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html#location-of-the-virtual-environment

    Also, my detailed conversation with mod_wsgi author is here: https://github.com/GrahamDumpleton/mod_wsgi/issues/396


  2. what is being reported in the apache error log?

    Can you add the param request-timeout to WSGIDaemonProcess and set it to something low, say 30 seconds? after such a change do you get “Site not reached” in about 30 seconds or does it still take 2-5 mins?

    Is the wsgi configuered to write logs anywhere? Can you see the request reaching the python app?

    Sorry for writing the questions as an answer but I still dont have the needed level to add comments.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search