On Fri, 4 Oct 2013 10:45:13 -0700 (PDT)
LightDot <[email protected]> wrote:
> Couple of things I don't understand - are you using anyserver.py or
> not?
No.
> Are you using nginx in front of gunicorn, or..?
Yes, nginx is used as reverse proxy.
> Please post your relevant config files and full startup lines.
Here is ~/nginx/conf/sites/web2py:
upstream gunicorn.web2py {
server unix:/home/somepath/virtualenvs/web2py/web2py.sock;
}
server {
listen 127.0.0.1:somelocalport;
server_name my.domain.com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://gunicorn.web2py;
break;
}
}
}
and here is part of gunicorn init script:
#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start: $local_fs $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Gunicorn processes
### END INIT INFO
NAME="web2py"
PROJECT_DIR="$HOME/virtualenvs/$NAME"
PYTHONPATH="$PROJECT_DIR/web2py"
PIDFILE="$PROJECT_DIR/$NAME.pid"
SOCKET="$PROJECT_DIR/$NAME.sock"
DAEMON=$PROJECT_DIR/bin/gunicorn
PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
OPTS="-D -b unix:///$SOCKET --worker-class sync --pid $PIDFILE
--pythonpath $PYTHONPATH --chdir $PYTHONPATH wsgihandler --preload"
WORKERS=1
start()
{
printf "Starting $NAME "
export PYTHONPATH=$PYTHONPATH;
cd $PROJECT_DIR;
$DAEMON $OPTS && echo "OK" || echo "failed";
}
[...]
Let me repeat that now it works, but I wonder why it didn't work without
having parameters_80.py file present in PROJECT_DIR/web2py ?
Sincerely,
Gour
--
As the ignorant perform their duties with attachment to results,
the learned may similarly act, but without attachment, for the
sake of leading people on the right path.
http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
--
The embodied soul may be restricted from sense enjoyment,
though the taste for sense objects remains. But, ceasing
such engagements by experiencing a higher taste,
he is fixed in consciousness.
http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
--
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/groups/opt_out.