Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11

后端 未结 2 668
迷失自我
迷失自我 2020-12-14 01:37

How do I get mod_wsgi for Apache2 that was compiled for Python 3.6.1?

(or any future Python version)

I am using a Python 3.6.1 virtual envi

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 02:28

    When I have used the @Graham Dumpleton suggestion to install the mod_wsgi using pip, got this error:

    RuntimeError: The 'apxs' command appears not to be installed or is not executable.
    Please check the list of prerequisites in the documentation for this package and
    install any missing Apache httpd server packages.
    

    To successfully compile and install the mod_wsgi through pip, I need to install the apache2-dev package on Ubuntu:

    sudo apt-get install -y apache2-dev
    

    On CentOS/Red Hat:

    sudo yum install httpd-devel
    

    After that pip install mod_wsgi completes successfully.

    Hope that might help others.

提交回复
热议问题