2

I'm trying to set up uWSGI for django using http://adambard.com/blog/start-to-finish-serving-mysql-backed-django-w/ and the tutorial at http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html. Following the directions I have:

(env1)ubuntu@ip-172-31-28-196:~$ ls
host_type.py  requirements.txt  test.py  tproxy
(env1)ubuntu@ip-172-31-28-196:~$ sudo chmod 666 test.py
(env1)ubuntu@ip-172-31-28-196:~$ uwsgi --http :8000 --wsgi-file test.py
*** Starting uWSGI 2.0.9 (64bit) on [Tue Mar  3 14:45:58 2015] ***
compiled with version: 4.8.2 on 03 March 2015 02:58:28
os: Linux-3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014
nodename: ip-172-31-28-196
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/ubuntu
detected binary path: /home/ubuntu/.virtualenvs/env1/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 7862
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
probably another instance of uWSGI is running on the same address (:8000).
bind(): Address already in use [core/socket.c line 764]

As you can see, there is another instance of a uWSGI running. How do I stop it?

user1592380
  • 1,833
  • 5
  • 26
  • 31
  • 1
    IMO (but slightly off-topic) those aren't ideal tutorials. Nginx can "speak" the UWSGI protocol so you want to proxy back to uwsgi. I'm probably in a slightly different scenario to you (I host many websites under one uwsgi "emperor") but this is how I did it and this demonstrated how nginx and uwsgi are linked http://tghw.com/blog/multiple-django-and-flask-sites-with-nginx-and-uwsgi-emperor – Oli Mar 03 '15 at 15:28
  • Thanks for looking at this. I'll read this over. What I'm really trying to do is wire up the amazon ec2 ip address to a virtualenv that I have running python3 so that I can develop using django and python 3 . I've been on this detour to try to get UWSGI working, but I would be fine if I could just solve the following: http://stackoverflow.com/questions/28818058/configuring-django-ec2-instance-to-use-a-virtualenv – user1592380 Mar 03 '15 at 15:54
  • BTW. the answer appears to be cntl-C – user1592380 Mar 03 '15 at 18:04

1 Answers1

2

You can stop it using:

sudo fuser -k 8000/tcp

This kills the process you have on your port 8000

david
  • 121
  • 4