问题
I have a Python Flask-restful app. I want to serve it through the Apache server instead of the development server.
I have the following in http.conf
file:
<VirtualHost *:80>
ServerName batch-autoscaling-algos
WSGIDaemonProcess optimzation_app user=mv2 group=mv2 threads=1
WSGIScriptAlias / /projects/mv2/millvi-auto-scaling/batch-auto-scaling/api/htdocs/optimization.wsgi
<Directory /projects/mv2/millvi-auto-scaling/batch-auto-scaling/api/htdocs/optimization_app>
WSGIProcessGroup optimization_app
WSGIApplicationGroup %{GLOBAL}
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Previously, I had PHP 5.6 and Apache 2.2 installed. So, I installed mod_wsgi
simply by yum search mod-wsgi
and then doing yum install
based on the appropriate Python version, so it worked well.
Now, I reinstalled PHP5.6 which automatically upgraded by Apache to version 2.4.
At this point when I do yum search mod-wsgi
, it says No matches found
. If I try to simply restart apache with the above mentioned configuration, it says Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration
.
What is the correct way to install mod_wsgi
. I am using Amazon Linux and Python version 2.7.
来源:https://stackoverflow.com/questions/37109038/installing-mod-wsgi-module-for-apache-2-4