Why is Dancer not running uWSGI + Apache?

My Dancer application crashes under the combination of uWSGI (2.0.7) + Apache (2.4.10) when it works freely in other environments (uWSGI + nginx, Starman + Apache, Dancer's own de-server). I can’t find any relevant information in the magazines. So I made a simple test application like

$ dancer -a tset 

Then they copied the default production.yml to uwsgi.yml , linked bin/app.pl to bin/app.psgi , created by tset.ini as follows:

 [uwsgi] plugins = psgi socket = 127.0.0.1:3033 uid = www gid = www-data chdir = /home/www/apps/tset/bin/ psgi = app.psgi processes = 1 master = true 

Made this ini available to uWsgi in /etc/uwsgi/apps-available by associating it with /etc/uwsgi/apps-enabled .

Restart uwsgi .

Then, for the Apache module (2.4.10) mod-proxy-uwsgi , a few lines are added to my conf virtual host:

 ProxyPass /adm/y uwsgi://127.0.0.1:3033/ 

This seems like a very fragile point, because it seems to me that I need to install uWSGIModifier1 5 here, but did not understand where and how?

Restarted Apache and received an "Internal Server Error". In the uwsgi log I only see:

 Tue Jan 19 02:10:36 2016 - spawned uWSGI worker 1 (pid: 21712, cores: 1) Tue Jan 19 02:10:56 2016 - -- unavailable modifier requested: 0 -- Tue Jan 19 02:24:44 2016 - -- unavailable modifier requested: 0 -- Tue Jan 19 02:27:14 2016 - -- unavailable modifier requested: 0 -- Tue Jan 19 02:27:17 2016 - -- unavailable modifier requested: 0 -- 

What is this requested "inaccessible modifier"?

There are no entries in apache error.log, entries in access.log, but there is no other information except state 500.

This behavior is reproduced with the steps above, so I hope you find out what is wrong with this combination?

+5
source share
1 answer

It seems to me that I need to install uWSGIModifier1 5 here, but did not understand where and how?

Yes you are right. You should set modifier 1 to 5, but uwsgi docs says mod_proxy_uwsgi:

Currently, the module does not have the ability to install modifiers, although this will be fixed soon.

This means that you cannot pass the modifier to the uWSGI instance using this method (uWSGI will use the 0 modifier if not specified)

To fix this problem, you can switch to mod_uwsgi or change the modifier that psgi is loaded onto using:

 plugins = 0:psgi 

instead

 plugins = psgi 
+3
source

Source: https://habr.com/ru/post/1240886/


All Articles