Nginx and Python

Hello,

i try for a tutorial Python / Django and Nginx unite.

http://www.collabspot.com/2012/08/14/setting-up-nginx-uwsgi-python-ubuntu-12-04/

That sounds like a multi-hosting, and was not particularly difficult.
But
something is wrong with the system.

When i want on the website, i become a 502 Bad Gateway. The Socket
would not be create.

Configuration:

gentoo-mobile conf # cat nginx.conf server { listen 80; server_name python.silviosiefke.de; root /var/www/python.silviosiefke.de/src/silviosiefke; access_log /var/www/python.silviosiefke.de/logs/access.log; error_log /var/www/python.silviosiefke.de/logs/error.log;

location / {
include /etc/nginx/configuration/uwsgi_params;
uwsgi_pass unix:///tmp/python.silviosiefke.de.sock;
}
}

gentoo-mobile conf # cat uwsgi.ini [uwsgi] # variables projectname = silviosiefke projectdomain = python.silviosiefke.de base = /var/www/python.silviosiefke.de # config protocol = uwsgi venv = /var/www/python.silviosiefke.de/venv pythonpath = /var/www/python.silviosiefke.de/src/silviosiefke module = %(projectname).wsgi socket = /tmp/python.silviosiefke.de.sock logto = /var/www/python.silviosiefke.de/logs/uwsgi.log 2013/01/21 18:50:17 [crit] 4539#0: *1 connect() to unix:///tmp/python.silviosiefke.de.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.2.20, server: python.silviosiefke.de, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///tmp/python.silviosiefke.de.sock:", : "python.silviosiefke.de"

The socket is not present in /tmp. Whereis the mistake?

Is there no way to make the Vhost configuration so that it does not
matter what the user is in? PHP, Perl or Python?

Really Thank you for help. Greetings
Silvio

On 21 January 2013 17:54, Silvio S. [email protected] wrote:>

The socket is not present in /tmp. Whereis the mistake?

It looks like uWSGI hasn’t created it. Perhaps you didn’t run it in a
way such that it had permission to do so.
I’m afraid I can’t help you troubleshoot that program and, just FYI,
this isn’t the mailing list on which to do that.

Is there no way to make the Vhost configuration so that it does not
matter what the user is in? PHP, Perl or Python?

If your code/container can listen on a socket, and you know what
protocol it speaks, and can deterministically configure nginx to use
that protocol, then there’s no reason why you can’t abstract the nginx
config away from having per-app knowledge. I suggest that it’s
probably more bother than it’s worth, unless you have very specific
mass-hosting or NoOps requirements, however.

Jonathan

Jonathan M. // Oxford, London, UK
http://www.jpluscplusm.com/contact.html

yeah, your uwsgi instance is not working or somehow socket is simply not
there.

and for the application-agnostic configuration; you basically have to
pass
some parameters to your upstreams about the current request and then
handle
these params from them. see there is a similar example on nginx
documentation:
http://wiki.nginx.org/Configuration#Python_via_uWSGI

go dig nginx and uwsgi config files from my multi-app scenario:
https://github.com/kirpit/webstack

cheers.

Hello,

On Mon, 21 Jan 2013 19:15:21 +0000
Jonathan M. [email protected] wrote:

It looks like uWSGI hasn’t created it. Perhaps you didn’t run it in a
way such that it had permission to do so.
I’m afraid I can’t help you troubleshoot that program and, just FYI,
this isn’t the mailing list on which to do that.

No it will be created. There was something wrong in my reading. :slight_smile:
When i not start uwsgi then the socket can not create.

Now i become the log:
2013/01/21 23:06:52 [crit] 7472#0: *5 connect() to
unix:///tmp/python.silviosiefke.de.sock failed (13: Permission denied)
while connecting to upstream, client: 192.168.2.20,
server: python.silviosiefke.de, request: “GET /favicon.ico HTTP/1.1”,
upstream: “uwsgi://unix:///tmp/python.silviosiefke.de.sock:”,
host: “python.silviosiefke.de:92

If your code/container can listen on a socket, and you know what
protocol it speaks, and can deterministically configure nginx to use
that protocol, then there’s no reason why you can’t abstract the nginx
config away from having per-app knowledge. I suggest that it’s
probably more bother than it’s worth, unless you have very specific
mass-hosting or NoOps requirements, however.

Mass hoster I’m not, I will not be. There are customers whose computers
and networks I care. Years ago, I once asked a hosting and now I host a
few more. But before I can offer my customers, I need to test self and
understand. I would not start with Apache again, Nginx has been a good
companion and should stay.

I try the way from nginx Wiki, maybe run it. When can i switch the
clients
to extra server for python hosting.

Regards & Thank you
Silvio

On Jan 21, 2013, at 3:26 PM, Silvio S. wrote:

unix:///tmp/python.silviosiefke.de.sock failed (13: Permission denied)

Well, there’s your problem…


Scott R.
[email protected]
http://www.elevated-dev.com/
(303) 722-0567 voice

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs