0

Trying to configure apache with mod_wsgi and Python3

mod_wsgi config

LoadModule wsgi_module /etc/httpd/mod_wsgi/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so 

Flask App config

 WSGIScriptAlias /test /var/www/FlaskApp/FlaskApp/flask_app.wsgi <Directory /var/www/FlaskApp/FlaskApp/> # set permissions as per apache2.conf file Options FollowSymLinks AllowOverride None Require all granted </Directory> ErrorLog /var/log/httpd/error.log LogLevel warn CustomLog /var/log/httpd/access.log combined 

I installed mod_wsgi for Python3 using pip3 install mod_wsgi4.6.7.tar.gz.

mod_wsgi.so for Python2.7 works but for Python3.6.6 it ignores the loadmodule directive.

The above is to setup a Flask application that will handle restapi.

2
  • Did you try to load both wsgi modules at the same time? Only one can be loaded as wsgi_module. Commented Jul 22, 2019 at 16:34
  • I removed the older module from the system using yum remove, just had one and it worked. Commented Jul 22, 2019 at 22:29

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.