Wsgi установлен, но "Модуль mod_wsgi не существует!" - PullRequest
0 голосов
/ 02 июля 2018

Я хочу установить модуль wsgi (используя Flask) с apache2, на Vagrant vm.

Ошибка при активации модуля:

09:52 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ python --version
Python 2.7.12

(env)
[09:56 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ sudo a2enmod mod-wsgi
ERROR: Module mod-wsgi does not exist!

(env)
[09:57 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ sudo a2enmod mod_wsgi
ERROR: Module mod_wsgi does not exist!
(env)

Итак, я проверяю установку:

[09:55 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ dpkg -l libapache2-mod-wsgi
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom                                          Version                     Architecture                Description
+++-============================================-===========================-===========================-=============================================================================================
ii  libapache2-mod-wsgi                          4.5.2-1+deb.sury.org~xenial amd64                       Python WSGI adapter module for Apache

Я хочу (пере) установить его:

[09:57 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ (sudo) pip install mod_wsgi
The directory '/home/vagrant/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/vagrant/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mod_wsgi
  Downloading https://files.pythonhosted.org/packages/9e/37/dd336068ece37c43957aa337f25c59a9a6afa98086e5507908a2d21ab807/mod_wsgi-4.6.4.tar.gz (2.6MB)
    100% |████████████████████████████████| 2.6MB 1.5MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-g9YSf2/mod-wsgi/setup.py", line 168, in <module>
        'missing Apache httpd server packages.' % APXS)
    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.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-g9YSf2/mod-wsgi/

Что такое "apxs"? Это компаньон http для wsgi?

Список активных модулей apache находится здесь:

$ sudo apachectl -M
Loaded Modules:
 ...
 wsgi_module (shared)    <-----------
 ...

Итак, все в порядке

Модуль находится в нужном месте:

[10:36 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ cat /etc/apache2/mods-available/wsgi.load
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
(env)
[10:38 ]-[vagrant@vm]-[/etc/apache2/mods-enabled]
$ ll /usr/lib/apache2/modules/mod_wsgi.so
-rwxrwxrwx 1 root root 223K mai    3  2016 /usr/lib/apache2/modules/mod_wsgi.so*

Я прочитал несколько уроков, и, я думаю, :), я делаю правильно:)

Большое спасибо.

Фабрис

...