After pip installing uWSGI there's no /etc/uwsgi/ directory - how can I use apps-enabled?

orokusaki picture orokusaki · Dec 20, 2012 · Viewed 11.8k times · Source

I've been using apt-get install uwsgi to install uWSGI for my Django application. Today, I realized I needed a feature that's not available until uWSGI 1.1, and Ubuntu 12.04.1 doesn't have anything after 1.0.x, at least according to my apt-get install uwsgi=1.1 attempt. So, I used:

pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz

After doing so, I get a message prescribing the use of /usr/local/bin/uwsgi to launch the program. I'm not a guru when it comes to compiling from source, but my understanding is that when you do so, nothing will be changed in the /etc/ directory. Is this correct? If not, why don't I have a /etc/uwsgi/ directory and, more specifically, a /etc/uwsgi/apps-enabled/ directory? Should I simply create the directories when installing uWSGI from source? I was hesitant to do so, considering there is no mention of this in the docs (I don't want something that accidentally works, etc.).

Answer

ghdpro picture ghdpro · Apr 12, 2013

Sorry for this very late reply, but maybe this will help people who'll find this answer in the future:

To get /etc/uwsgi etc, you need to install the uwsgi package from Debian or Ubuntu (whatever you are using) by running aptitutde install uwsgi. However this will by default probably install an ancient version of uwsgi! The uwsgi binary is placed in /usr/bin/uwsgi when installing uwsgi this way.

To get the latest version, also install uwsgi using pip using pip install -U uwsgi, which (on my Ubuntu system at least) will put the uwsgi binary in /usr/local/bin/uwsgi then go do the following:

cd /usr/bin/

mv uwsgi uwsgi-old

ln -s /usr/local/bin/uwsgi uwsgi

Alternatively: edit the uwsgi init script and edit the DAEMON="/usr/bin/uwsgi" appropriately.

Et voila: "debianism" (full init scripts, etc) and the latest uwsgi binary!