WebFaction
Community site: login faq

I'm trying to setup a Web2Py application for the first time and can't seem to get it working. After looking around and trying several outdated or overly complex installation methods I'm out of ideas, any help getting Web2Py running would be much appreciated.

The best setup I can find seems to be using anyserver.py to connect to a WebFaction custom app (listening on port), but running python anyserver.py -s cgi -i 127.0.0.1 -p MY_APPLICATION_PORT -l errors with this:

starting cgi on 127.0.0.1:14218...
ERROR:web2py:Traceback (most recent call last):
  File "/home/brycenew/webapps/ideaboards/web2py/gluon/main.py", line 317, in wsgibase
    (static_file, version, environ) = url_in(request, environ)
  File "/home/brycenew/webapps/ideaboards/web2py/gluon/rewrite.py", line 189, in url_in
    return regex_url_in(request, environ)
  File "/home/brycenew/webapps/ideaboards/web2py/gluon/rewrite.py", line 628, in regex_url_in
    path = urllib_unquote(request.env.path_info) or '/'
  File "/usr/lib64/python2.7/urllib.py", line 1217, in unquote
    bits = s.split('%')
AttributeError: 'NoneType' object has no attribute 'split'

Status: 500 INTERNAL SERVER ERROR
Content-Type: text/html; charset=UTF-8
web2py_error: ticket unrecoverable
Content-Length: 719

<html><body><h1>Internal error</h1>Ticket issued: <a href="/admin/default/ticket/unrecoverable" target                                     ="_blank">unrecoverable</a></body></

asked 05 Jun, 04:29

Cyreb
325
accept rate: 100%


I managed to get the server working without much trouble via uWSGI following this post.

permanent link

answered 05 Jun, 18:20

Cyreb
325
accept rate: 100%

Simplest method to start it up is using the built-in rocket server and check if everything is working:

python /your/path/to/web2py/directory/web2py.py -L options.py

where: options.py is your startup config options including port, application, etc. that you can also set on command line.

config file looks something like (replace 1st '!!' with < and last '!!' with >):

# -*- coding: utf-8 -*-
import socket
import os
    #ip = '0.0.0.0'
port = your port number here
password = '!!recycle!!'  # !!recycle!! means use the previous password, don't prompt
pid_filename = 'httpserver.pid'
# log_filename = 'httpserver.log'
minthreads = 10   # default 10
maxthreads = 30   # default 0 (create and delete more as needed)
server_name = socket.gethostname()
request_queue_size = 5
timeout = 10 # default is 10
shutdown_timeout = 5
folder = os.getcwd()
extcron = None
nocron = None

More info: http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options

Hope that helps.

permanent link

answered 05 Jun, 11:49

houdinihound
3627
accept rate: 66%

edited 05 Jun, 12:20

Thanks, but as the documentation recommends against using Rocket for production environments so I was hoping to hook into Apache or Nginx:

http://web2py.com/books/default/chapter/29/13/deployment-recipes#Deployment-recipes-Infrastructure

(05 Jun, 18:16) Cyreb
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×47
×31
×24

question asked: 05 Jun, 04:29

question was seen: 64 times

last updated: 05 Jun, 18:20

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM