Re: Webware times out on WebFaction Hosting service

Roger Haase <crosseyedpenguin-/[email protected]> Sun, 24 Jul 2011 15:36:13 -0700 (PDT)
Newsgroups gmane.comp.python.webware
Message-ID <[email protected]>



----- Original Message -----
From: Roger Haase <crosseyedpenguin-/[email protected]>
To: Discussion of Webware for Python including feedback and proposals. <web=
[email protected]>
Cc: =

Sent: Saturday, July 23, 2011 4:57 AM
Subject: Re: [Webware-discuss] Webware times out on WebFaction Hosting serv=
ice





----- Original Message -----
From: Christoph Zwerschke <[email protected]>
To: Discussion of Webware for Python including feedback and proposals. <web=
[email protected]>
Cc: =

Sent: Saturday, July 23, 2011 2:20 AM
Subject: Re: [Webware-discuss] Webware times out on WebFaction Hosting serv=
ice

Am 23.07.2011 07:05 schrieb Roger Haase:
> I have added a WebFaction "Custom app (listening on port)" to obtain
> a unique port number. Then I modified my wsgiadapter to point at
> 184.172.207.73:41759 and modified the app serverconfiguration to
> listen at the same address.

Which Webware version are you using? Webware normally connects to Apache =

via mod_webkit; only the last beta supports mod_wsgi.

-- Christoph

------------------------------------------

I have been running Webware 1.1b1 with the mod_wsgi adapter since May, 2010=
 on Ubuntu 10.04 and Ubuntu 11.04.=A0 The Python version is 2.7.1 on Webfac=
tion.=A0 =


I will start over with a clean installation of Webware and give the mod_web=
kit adapter a try if the problems with wsgi continue.

Chuck and Christof, thanks for your thoughts.

Roger Haase

-----------------------------------------
I have some progress.=A0 I think the WSGIAdapter.py has a bug -- I could no=
t use a non-standard port on Ubuntu 11.04.=A0 I copied a few lines of code =
from CGIAdapter.py to read adapter.address and pass on the host and port.=
=A0 My Patch:

"""
diff -r 326014bd2b8f WebKit/Adapters/WSGIAdapter.py
--- a/WebKit/Adapters/WSGIAdapter.py=A0=A0=A0 Sun Jul 24 14:37:54 2011 -0700
+++ b/WebKit/Adapters/WSGIAdapter.py=A0=A0=A0 Sun Jul 24 14:52:42 2011 -0700
@@ -7,7 +7,7 @@
=A0This script expects to find a file in its directory called =

=A0'adapter.address' that specifies the address of the app server. =

=A0If the address file is not found, the address is taken from =

-the configuration file called 'WSGIAdapter.conf'. =

+the configuration file called 'WSGIAdapter.config'. =

=A0 =

=A0Contributed to Webware for Python by Christoph Zwerschke, 04/2010. =

=A0 =

@@ -55,6 +55,11 @@
=A0=A0=A0=A0 def __call__(self, environ, start_response): =

=A0=A0=A0=A0=A0=A0=A0=A0 """The actual WSGI application.""" =

=A0=A0=A0=A0=A0=A0=A0=A0 err =3D StdErr(environ.get('wsgi.errors', None)) =

+=A0=A0=A0=A0=A0=A0=A0 host, port =3D open(os.path.join(self._webKitDir, =

+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 'adapter.address')).read().split(':', 1) =

+=A0=A0=A0=A0=A0=A0=A0 if os.name =3D=3D 'nt' and not host: =

+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 host =3D 'localhost' # MS Windows doesn'=
t like a blank host name =

+=A0=A0=A0=A0=A0=A0=A0 port =3D int(port) =

=A0=A0=A0=A0=A0=A0=A0=A0 try: =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 inp =3D environ.get('wsgi.input', None=
) =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if inp is not None: =

@@ -73,7 +78,7 @@
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 environ =3D dict(item for item in envi=
ron.iteritems() =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if isinstance(item[1], (bo=
ol, int, long, float, =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 str, unicode, =
tuple, list, set, frozenset, dict))) =

-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 response =3D self.getChunksFromAppServer=
(environ, inp or '') =

+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 response =3D self.getChunksFromAppServer=
(environ, inp or '', host=3Dhost, port=3Dport) =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 header =3D [] =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 for chunk in response: =

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if header is None:
"""

The above works for me on Ubuntu 11.04.=A0 I am not sure if the additional =
code should be moved down within the try statement.=A0 =


I am still working on resolving the WebFaction problem.=A0 With the patch a=
pplied, I now get "bad marshall data" errors.=A0 This is my first experienc=
e with web hosts.=A0 There are about 170 other users on my server and nginx=
 is used to give each user their own apache conf file.=A0 I suspect nginx h=
as some kind of attachment to my "custom port" that is causing the problem,=
 but am still looking.

Roger Haase





=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if header is None:


---------------------------------------------------------------------------=
---
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/