After pip installing uWSGI there's no /etc/uws

2019-03-20 20:10发布

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.).

2条回答
Evening l夕情丶
2楼-- · 2019-03-20 20:20

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!

查看更多
干净又极端
3楼-- · 2019-03-20 20:28

/etc/uwsgi and friends is a 'debianism'. The uWSGI project is all about the sysadmin taste, so if you like the /etc/uwsgi approach just create the directory, drop config files in it and start the uWSGI Emperor to manage instances.

查看更多
登录 后发表回答