Change mod_wsgi from python3.5 to 3.6

微笑、不失礼 提交于 2019-12-05 13:02:39
Nitzan Cohen

WOHA! It's working!
I uninstalled the mod_wsgi (sudo apt get remove libapache2-mod-wsgi). Then, Installed the module via pip specifically to python3.6 (python3.6 -m pip install mod_wsgi), but at this point the apache still ran python3.5.
I added to the apache configuration file (in ubunutu 16.4 the file is located at: /etc/apache2/apache2.conf and /usr/local/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so for RHEL/CentOS 7) the followings:
LoadModule wsgi_module "/usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
and
WSGIPythonHome "/usr" and that did the trick.
I weeped a lot of tears over this issue, finding the apache2.conf file etc, so hopefully this will be helpful to anyone.

The LoadModule solution worked for me. However, I found it easiest to first ensure a2dismod wsgi as provided by the default apache2 module. I spent 3 days looking at various solutions and answers and reviewing Graham's WSGI guide.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!