Hi,
I have followed the
tuto http://web2py.com/books/default/chapter/29/13/deployment-recipes#Nginx
and i have the error :
2017/04/05 11:50:39 [crit] 15056#0: *1 connect() to
unix:///tmp/web2py.socket failed (2: No such file or directory) while
connecting to upstream,
i tried a touch /tmp/web2py.socket && chmod 777 /tmp/web2py.socket but
error, WHY
In the forum there are a lot of answers but none of the work
# /etc/init.d/nginx restart
[ ok ] Restarting nginx (via systemctl): nginx.service.
# /etc/init.d/uwsgi-emperor restart
[ ok ] Restarting uwsgi-emperor (via systemctl): uwsgi-emperor.service.
www-data 14972 0.0 0.0 48320 3492 ? S 11:40 0:00
/usr/bin/uwsgi --ini /etc/uwsgi-emperor/emperor.ini --pidfile
/run/uwsgi-emperor.pid --daemonize /var/log/uwsgi/emperor.log
www-data 14973 0.0 0.0 48084 656 ? S 11:40 0:00 \_
/usr/bin/uwsgi --ini /etc/uwsgi-emperor/emperor.ini --pidfile
/run/uwsgi-emperor.pid --daemonize /var/log/uwsgi/emperor.log
root 15007 0.0 0.0 101568 3164 ? Ss 11:40 0:00 nginx:
master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 15008 0.0 0.0 101928 3784 ? S 11:40 0:00 \_ nginx:
worker process
www-data 15009 0.0 0.0 101928 3784 ? S 11:40 0:00 \_ nginx:
worker process
www-data 15010 0.0 0.0 101928 3784 ? S 11:40 0:00 \_ nginx:
worker process
www-data 15011 0.0 0.0 101928 3784 ? S 11:40 0:00 \_ nginx:
worker process
File :
/etc/init/uwsgi-emperor.conf
# Emperor uWSGI script
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]
respawn
exec uwsgi --master --die-on-term --emperor /etc/uwsgi --logto
/var/log/uwsgi/uwsgi.log
File : /etc/uwsgi/web2py.xml
<uwsgi>
<socket>/tmp/web2py.socket</socket>
<pythonpath>/var/www/web2py/</pythonpath>
<mount>/=wsgihandler:application</mount>
<master/>
<processes>4</processes>
<harakiri>60</harakiri>
<reload-mercy>8</reload-mercy>
<cpu-affinity>1</cpu-affinity>
<stats>/tmp/stats.socket</stats>
<max-requests>2000</max-requests>
<limit-as>512</limit-as>
<reload-on-as>256</reload-on-as>
<reload-on-rss>192</reload-on-rss>
<uid>www-data</uid>
<gid>www-data</gid>
<no-orphans/>
</uwsgi>
Nginx 1.6
# file /etc/nginx/sites-available/web2py
server {
listen 9090;
server_name $hostname;
#to enable correct use of response.static_version
#location ~* /(\w+)/static(?:/_[\d]+.[\d]+.[\d]+)?/(.*)$ {
# alias /home/www-data/web2py/applications/$1/static/$2;
# expires max;
#}
location ~* /(\w+)/static/ {
root /var/www/web2py/applications/;
#remove next comment on production
#expires max;
}
location / {
#uwsgi_pass 127.0.0.1:9001;
uwsgi_pass unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}
}
server {
listen 443 default_server ssl;
server_name $hostname;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers
ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
ssl_protocols SSLv3 TLSv1;
keepalive_timeout 70;
location / {
#uwsgi_pass 127.0.0.1:9001;
uwsgi_pass unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}
The keys
ls -l /etc/nginx/ssl/
total 16
-rw-r--r-- 1 root root 757 avril 5 10:38 server.crt
-rw-r--r-- 1 root root 603 avril 5 10:37 server.csr
-rw-r--r-- 1 root root 891 avril 5 10:38 server.key
-rw-r--r-- 1 root root 963 avril 5 10:38 server.key.org
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.