![]() |
The Perfect SpamSnake - Ubuntu Jeos 10.04 - Nginx, uWSGI & Baruwa
Hi All,
wondering if any of you can give me a hand as im slowly frying my brain with this. My problem is as follows, I have setup MailScanner no problems, works fine, its just the Nginx, uWsgi and baruwa combination that are giving me headaches. I know im not using the prescribed 10.10 but it wasn't an option and I quite like LTS. Basically I have setup as per the how-to (associated conf and ini files below) and all I get at the moment is: uWSGI Error wsgi application not found /etc/uwsgi/uwsgi-python2.6/baruwa.ini: [uwsgi] socket = /var/run/uwsgi/uwsgi-python2.6/baruwa/socket master = true processes = 2 env = DJANGO_SETTINGS_MODULE=baruwa.settings module = django.core.handlers.wsgi:WSGIHandler() /etc/nginx/sites-available/baruwa.conf: server { listen 80; server_name exam.example.com; root /usr/share/pyshared/baruwa; #main access log access_log /var/log/nginx/access.log; #main error log error_log /var/log/nginx/error.log; location /static { root /usr/share/pyshared/baruwa/static/; } # static resources location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar |bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp| rtf|js)$ { expires 30d; break; } location / { uwsgi_pass unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/socket; include uwsgi_params; } } One thing that is obvious is the socket, before everyone shouts at once a "ls /var/run/uwsgi/uwsgi-python2.6/baruwa" returns: pid socket Hence the change from 'baruwa.sock' to 'socket'. Please let me know if there is anymore information you need or if you would like me to test anything. Thanks Muchly, Drex |
Hey,
Try this in your baruwa.ini: pythonpath = /usr/share/pyshared/baruwa/ Restart nginx and uwsgi. Let me know if that worked. |
Hi Rocky,
Thanks for the suggestion, unfortunately, still a no-go, I have noticed this, however, when I restart uwsgi: Code:
# /etc/init.d/uwsgi-python2.6 restartAnyway my Code:
/etc/uwsgi/uwsgi-python2.6/baruwa.iniCode:
[uwsgi]Code:
/etc/init.d/uwsgi-python2.6Code:
#!/bin/shDrex |
Change the socket back to baruwa.sock, try to restart and see what happens. I haven't seen that error and not sure why it's happening right now. I'll dig some more. Have you altered anything with uwsgi/nginx after the setup beside the ini and conf files?
|
Hi Rocky,
Well changed baruwa.ini and baruwa.conf back to baruwa.sock and restart bout uWSGI and nginx (in that order) and now have a lovely "502 gateway" error. This is the error I initailly cam across when I started everything up which led me to change the socket to "socket". Other than that everything is set as per the guide. Thanks for all your help thus far, I spent a long time trying to google the error before posting and couldn't find anything or relevance on it. Thanks, Drex |
Does this folder exist in your setup?
/var/run/uwsgi/uwsgi-python2.6/baruwa/ Change the socket line to /tmp/baruwa.sock in your ini and conf file and see what happens. What's in your uwsgi-python2.6 log file? |
Hi Rocky,
Yes, /var/run/uwsgi/uwsgi-python2.6/baruwa does exist and has the PID and the Socket files inside it. I changed the 2 baruwa files and still no joy. Am i correct in assuming that the /etc/uwsgi/uwsgi-python2.6/baruwa.ini file sets the socket and pid locations? If this is correct it would assume that the baruwa.ini is not being read correctly? Thanks for all your help thus far, Drex |
Hi Rocky,
Here is my log file: Code:
Sat Dec 11 20:26:06 2010 - SIGINT/SIGQUIT received...killing workers...Regards, Drex. |
Hi Rocky,
I changed the socket back to /var/run/uwsgi/uwsgi-python2.6/baruwa/socket and restart uwsgi and nginx, my logfile now looks like this: Code:
Mon Dec 13 10:30:45 2010 - SIGINT/SIGQUIT received...killing workers... |
Hi Rocky,
I'VE FOUND THE PROBLEM!!!!! yey! I've been playing with the command that the init.d script uses to start uwsgi. The script created this command line (That I found using ps): Code:
/usr/bin/uwsgi-python2.6 --master --no-orphans --processes 2 --logdate --chmod-socket=660 --uid www-data --gid www-data --daemonize /var/log/uwsgi/uwsgi-python2.6/baruwa.uwsgi-python2.6.log --pidfile /var/run/uwsgi/uwsgi-python2.6/baruwa/pid --socket /var/run/uwsgi/uwsgi-python2.6/baruwa/socket -- /etc/uwsgi/uwsgi-python2.6/baruwa.iniSo.. my question now is, how do i get it to add it into the command line??? :confused: Thanks for all your hard work and if I find the solution before yourself, I'll post it here! Much Regards, Drex |
| All times are GMT +2. The time now is 10:03. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.