问题
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.).
回答1:
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!
回答2:
/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.
来源:https://stackoverflow.com/questions/13965555/after-pip-installing-uwsgi-theres-no-etc-uwsgi-directory-how-can-i-use-apps