group.of.nepali.translators team mailing list archive
-
group.of.nepali.translators team
-
Mailing list archive
-
Message #16238
[Bug 1501854] Re: mod_proxy_uwsgi doesn't work with unix domain sockets
This bug was fixed in the package uwsgi - 2.0.12-5ubuntu3.1
---------------
uwsgi (2.0.12-5ubuntu3.1) xenial; urgency=medium
* Re-add patch cherry-picked upstream to fix apache 2.4 integration
with unix domain sockets (accidentally dropped in 2.0.12-1).
LP: #1501854
-- Stefano Rivera <stefanor@xxxxxxxxxx> Tue, 29 Aug 2017 13:02:59
-0700
** Changed in: uwsgi (Ubuntu Xenial)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1501854
Title:
mod_proxy_uwsgi doesn't work with unix domain sockets
Status in uwsgi package in Ubuntu:
Fix Released
Status in uwsgi source package in Xenial:
Fix Released
Status in uwsgi package in Debian:
Fix Released
Bug description:
= SRU =
== Impact ==
Using unix domain sockets for getting traffic from Apache to uwsgi is
impossible. This is a regression from previous releases.
== Regression Potential ==
Patch is upstream, and that part of the codebase hasn't been touched since. Presumably that means it has been well tested by other uwsgi users.
It was also previously applied in the Debian/Ubuntu package. It was dropped by accident.
The patch only applies to the mod_proxy_uwsgi module, so no other bits
of uwsgi should be affected (it does build *many* binaries and
packages).
== Test Case ==
=== demo.conf ===
<VirtualHost *:80>
ServerName localhost
ProxyPass / unix:/run/demo.sock|uwsgi://demo/
</VirtualHost>
=== demo.ini ===
[uwsgi]
plugin = python3
socket = /run/demo.sock
umask = 0111
wsgi-file = demo.py
=== demo.py ===
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello World"]
=== Steps ===
1. apt install apache2 libapache2-mod-proxy-uwsgi uwsgi-plugin-python3
2. a2enmod proxy_uwsgi
3. rm /etc/apache2/sites-enabled/000-default.conf
4. cp demo.conf /etc/apache2/sites-enabled/
5. service apache2 restart
lazy chroot option: (. /etc/apache2/envvars; apache2)
6. uwsgi --ini demo.ini
7. curl http://localhost/
Success: Hello World
Failure: A 502 Proxy Error, with this in the logs:
DNS lookup failure for: demo returned by /
= ORIGINAL REPROT =
If I specify "ProxyPass unix:/run/uwsgi/app/site/socket|uwsgi://" (this is inside of a location block, so need for the initial path) I will get "error parsing URL //: Invalid host/port" in the apache logs when I try to access that URL. If I try to change the final part (ie. "|uwsgi://" to "|uwsgi://localhost/"), it just tries to connect through TCP.
The problem is fixed (at least for me) by the patch from the mailing
list: http://lists.unbit.it/pipermail/uwsgi/2015-September/008185.html
(I also let Debian know about this, so perhaps the fix will come from
upstream - https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=752783#35).
There is also a workaround: use "vanilla" mod_proxy_http over unix
domain sockets:
ProxyPass "/foo" "unix:/var/run/uwsgi/foo.socket|http://uwsgi-uds-
foo/"
PS. Apparently, if you have multiple instances of uwsgi you want to
connect to, you need to specify different names for them (ie. "http
://uwsgi-uds-foo/", "http://uwsgi-uds-bar/", etc), having just
different paths to the sockets will not work.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/uwsgi/+bug/1501854/+subscriptions