OS/Ubuntu  2015/02/27 16:59

If you uwsgi is installed by pip, you only got the executeable file in /usr/local/bin/uwsgi, you need to daemonize it yourself.

When you open some of the file in /etc/init.d/, you may feel sad:
I just want to register uwsgi as a service, why I need to write so long a script which looks similar to the others? It doesn't make sense.

Good news is that it is quite simple with the help of Upstart, which is an alternative to sysvinit. It use /etc/init/ instead of /etc/init.d/.

Just create a file /etc/init/uwsgi.conf with following content:

description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [!2345]
exec /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals/ --logto /var/log/uwsgi.log

and then, you can mangage your uwsgi process like this:

sudo initctl start|stop|restart|reload| uwsgi

or, still this:

sudo service uwsgi start|stop|restart|reload

Yes, as you can see, the service command is smart, it can manage service from both sysvinit and Upstart, with the same command.

And, if you have both /etc/init.d/uwsgi and /etc/init/uwsgi.conf, when you say:

sudo service uwsgi restart

It will restart the Upstart file /etc/init/uwsgi.conf.
The sysvinit one will be ignored, or something similar.

uwsgi config for your site

I recomend everyone to use the pip and Upstart way, it's much better then the apt-get way.

If so, you are using the emperor mode of uwsgi, which is very handy and powerful.

Now, you can create a ini file in /etc/uwsgi/vassals/ like this:


The %n means your file name. For example, my project name is 'readfree', I create a readfree.ini file for it. Then the %n means 'readfree'. You don't need to replace it with real name. uwsgi will do this for you.

And then restart or reload uwsgi:

sudo service uwsgi restart

2015/02/27 16:59 2015/02/27 16:59
이 글에는 트랙백을 보낼 수 없습니다

Create a file .pycharmrc in your home folder with the following contents

source ~/.bashrc
source ~/pycharmvenv/bin/activate

Using your virtualenv path as the last parameter.

Then set the shell Preferences->Project Settings->Shell path to

/bin/bash --rcfile ~/.pycharmrc
2015/02/27 10:31 2015/02/27 10:31
이 글에는 트랙백을 보낼 수 없습니다
분류없음  2014/09/07 10:16
2014/09/07 10:16 2014/09/07 10:16
이 글에는 트랙백을 보낼 수 없습니다
OS  2014/09/06 15:17
sudo -s

add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java7-installer

apt-get install -y subversion secpanel gedit filezilla gparted xchm vim nginx php5 php5-common php5-curl php-pear php5-fpm php5-mysql php5-xdebug php5-dev python-pip php5-mcrypt g++ git language-selector-gnome uim uim-byeoru tilda build-essential python-dev

pip install pymongo simplejson requests uwsgi fabric

git clone git://
cd node
sudo make install
node --version && npm --version

npm install --g yo generator-angular@0.9.2 phantomjs karma
yo --version && bower --version && grunt --version

ln -s /usr/local/lib/node_modules/karma/bin/karma /usr/local/bin
2014/09/06 15:17 2014/09/06 15:17
이 글에는 트랙백을 보낼 수 없습니다

sudo -u username command
2014/06/12 17:58 2014/06/12 17:58
이 글에는 트랙백을 보낼 수 없습니다
kinuz:누즈의 웹 블로그
누즈의 웹 블로그
전체 (425)
Language (136)
Database (71)
OS (126)
Programs (52)
MyFavorite (10)
CaPoEiRa (2)
유용한 정보 (16)
server (1)
PDA (5)
여행 (0)
애자일 (1)
Sublime Text (1)
«   2015/12   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
  1. 2015/02 (2)
  2. 2014/09 (2)
  3. 2014/06 (3)
  4. 2014/04 (3)
  5. 2013/12 (1)