Installing mod_wsgi module for Apache 2.4

*爱你&永不变心* 提交于 2019-12-11 04:44:00

问题


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

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