WebFaction
Community site: login faq

I am a new WebFaction user trying to port an old WebwareForPython WebKit application. Webware/WebKit has an application server that runs on a separate port (default 8086) -- see here: http://www.webwareforpython.org/WebKit/Docs/InstallGuide.html#architecture

The above docs are outdated, I am using an apache mod_wsgi to connect to the WebKit application server. I have added a Custom app (listening on port) to obtain a unique port number. Then I modified my wsgi adapter to point at 184.172.207.73:41759 and modified the app server configuration to listen at the same address.

The problem is that the wsgi adapter and app server are not making a connection and I always get a timed out error.

Any ideas as to what I am doing wrong?

asked 22 Jul '11, 16:29

crosseyedpen...
11134
accept rate: 0%

I tried to get Webware 1.1b1 running myself under mod_wsgi but was not successful.

WSGIAdapter.py has this cryptic note in the opening comments...

This script expects to find a file in its directory called
'adapter.address' that specifies the address of the app server.
If the address file is not found, the address is taken from
the configuration file called 'WSGIAdapter.conf'.

.... but I'm really not sure what they mean by 'address of the app server' in this context, since Apache and mod_wsgi are (I think) replacing the role of the app server.

My advice is that you take this question to the Webware mailing list and ask there: http://news.gmane.org/gmane.comp.python.webware

Sorry!

(22 Jul '11, 18:42) seanf

Thanks for your reply. I have Webware 1.1b1 running under Ubuntu 10.04 and 11.04. If Webware were rewritten today, it would not need an AppServer, but it was written in 2000 and still requires it.

The adapter.address file is created each time the AppServer is started (manually, for now) and deleted when the app server is stopped. it contains only the string '184.172.207.73:41759'. The 'WSGIAdapter.conf' mentioned in the doc is a typo, it should say 'WSGIAdapter.config'. The contents of my WSGIAdapter.config is:

  NumRetries = 20
  SecondsBetweenRetries = 3
  Host = '184.172.207.73'
  AdapterPort = 41759

I will give the Webware mailing list a try, but I am thinking the port I am getting with the "Custom app (listening on port)" is not the kind of port Webware requires.

seanf, others, has anyone managed to get Webware to run under WebFaction with one of the other WebKit adapters?

(22 Jul '11, 23:43) crosseyedpen...

I haven't ever attempted to run Webware, but can provide some more information regarding the Custom App (listening on port) application type. This application essentially configures the front-end Nginx server to accept requests for your domain and then proxy_pass them to localhost:PORT, where PORT is the port assigned to your application in the control panel. There should be an application server at this location to receive and handle the request, and pass a response back to Nginx.

Localhost is the IP address "127.0.0.1", so specifying a Host address of "184.172.207.73" isn't going to work because port 41759 isn't open on that IP address. I would suggest trying "127.0.0.1" instead. Hope that helps!

(23 Jul '11, 00:05) ryans ♦♦

Re:

seanf, others, has anyone managed to get Webware to run under WebFaction with one of the other WebKit adapters?

I was able to get Webware running on its own AppServer by creating two 'custom app listening on port' applications (one for the app server, and one for the adapter), and using the following relevant settings in WebKit/Configs/AppServer.config:

# This is the IP address at which the application server will listen:
Host = '127.0.0.1' # use '' for listening on all network interfaces

EnableAdapter = True # enable WebKit adapter
AdapterPort = 52059 # the port assigned to my adapter app

EnableHTTP = True # enable built-in Webserver
HTTPPort = 11224 # the port assigned to my appserver app

I then added my appserver app to a site in the control panel and ran...

./WebKit/AppServer

... from my Webware installation directory and was then able to view the default Webware site in my browser.

Hope that helps!

permanent link

answered 23 Jul '11, 10:34

seanf
12.2k42136
accept rate: 37%

Thanks everyone for your suggestions. I finally got the Webware for Python WSGI adapter working. Here are my WebFaction additions to the standard Webware install docs:

Install Webware For Python 1.1b1 or later release or beta. If 1.1b1 is used, add an updated WSGIAdapter.py not included in beta 1:

http://svn.w4py.org/Webware/trunk/WebKit/Adapters/WSGIAdapter.py

Add a WebFaction "Custom app (listening on port)" to obtain a unique port number. This creates a empty (and useless) folder with the chosen app name.

Change WSGIAdapter.config to include the unique port number:

  NumRetries = 20
  SecondsBetweenRetries = 3
  Host = '127.0.0.1'
  AdapterPort = 41759

Change a couple of AppServer.config lines to look like the following. We cannot use the built-in web server, so just disable it to save a few bytes.

EnableAdapter = True # enable WebKit adapter
AdapterPort = 41759

EnableHTTP = False # disable built-in Webserver
HTTPPort = 8080

If you are using a later python than the 2.4.3 WebFaction default, change the AppServer file to specify a specific version. AppServer is an .sh file, so this change is required even if you have followed the WebFaction docs to specify a default Python in the .bash_profile.

# You may want to use a specific Python executable:
PYTHON=python2.7
permanent link

answered 25 Jul '11, 15:31

crosseyedpen...
11134
accept rate: 0%

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
×7
×1
×1
×1

question asked: 22 Jul '11, 16:29

question was seen: 3,292 times

last updated: 25 Jul '11, 15:31

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 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