Saturday, April 28, 2007

waiting for Sun's Try & Buy

Cubulus can scale (tested on 1 and 2 cores computers = we can call this "theory" with regards to real servers) horizontally and vertically. I just can't wait for the Sun Ultra T1000 server from Try & Buy programme.

24 threads (or 32, depending on config), now that's scaling !

Monday, April 23, 2007

Cubulus OLAP mentioned by Gobán Saor

Submitting Cubulus on Freshmeat was very succesfull: people started noticing it, and writing about it. For example
Goban Saor

Sunday, April 22, 2007

Cubulus OLAP mentioned in Chris Webb's blog

Cubulus OLAP mentioned in Chris Webb's blog:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!1132.entry

Hurray!!

Friday, April 20, 2007

Python and multiple processes

Hi,

Somebody was wondering about locking in Python (and CherryPy), link: http://groups.google.com/group/cherrypy-users/browse_thread/thread/bbc2800aa0f329c4?hl=en

Why not running running multiple python processes for CherryPy ? That would ease the GIL . You can "load balance" requests with Apache's mod_proxy .

If you need sessions, try web reverse proxy + state-full balancer called Pound : http://www.apsis.ch/pound/

From the docs: "a load balancer: it will distribute the requests from the client browsers among several back-end servers, while keeping session information." ... "Five possible ways of detecting a session have been implemented in Pound (hopefully the most useful ones): by client address, by Basic authentication, by URL parameter, by cookie and by header value"

Cheers, Alex

Wednesday, April 4, 2007

digest authentication with CherryPy

For the authorizations, Trac project elegantly delegates authentication to Apache , see here

Unaware of Trac solution, I was fighting problem on my own:

CherryPy has built-in support for authorization. "Digest" and "ldap" are the ones that make most sense in practice.

I've been wondering if CherryPy is the right place for doing authorization. Because instead of _coding_ authorization it is easier to _declare_ it in the front web servers. Instead of re-inventing the wheel, let the right tool handle the job.

IMHO it is the Right Thing (TM) to do, since it also makes sense to use a reverse proxy (apache/lighttpd/squid) in front of CherryPy to deal with buffer overflows, malformed URLs and other nasty things.

This allows CherryPy to run in session-less mode, which allows for easier fail-over or load balancing. Another benefit Windows users: one could use "Integrated Windows Authorization" with IIS.

I tried to deploy this with Apache mod_proxy and mod_digest. Unfortunately, mod_proxy "eats" all extra headers (see http://allafrica.com/tools/apache/mod_proxy ). On Webfaction forum, Remi Delon suggested to try mod_rewrite. Well, Apache mod_rewrite is "voodoo" (quote from http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html).. If someone manages to get it work, please let me know.

Instead, here is quick-and-dirty solution with .. lighttpd. Relevant lines from lighttpd.conf are :
server.modules = (
"mod_access",
"mod_auth",
"mod_proxy",
"mod_accesslog" )
server.port = 8090
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8080 ) ) )
auth.backend = "plain"
auth.backend.plain.userfile = "/opt/local/etc/lighttpd/lighttpd.user"
auth.require = ( "/" => (
"method" => "digest",
"realm" => "cubulus",
"require" => "valid-user"
) )

CherryPy receives header 'Authorization' with content 'Digest username="a", realm="cubulus", nonce=.., uri=.. qop="auth" ..... '

Easy thing is that if authorization fails, CherryPy receives.. nothing, so it's enough to look for Digest username="XXX"

Cheers, Alex
links: CherryPy wiki , Webfaction forum

Monday, April 2, 2007

digest authentication in CherryPy

Apache already has mod_digest (and mod_ldap), and IMHO it is better to delegate security to Apache (rather than re-implement digest in CherryPy). Also, it might be safer to _configure_ security declaratively than code it.

Has anyone deployed CherrPy behind mod_digest (or mod_ldap), and retrieved the "Authorization-Info" ?

Or, is it a wrong question? I am trying a parallel with MS IIS , where is possible to set Directory Security to "Windows Integrated". The CGI or ASP pages retrieve the "authenticated user" server variable, or headers.

When deploying CherryPy (3.0.1) behind Apache (Apache/1.3.33-Darwin with mod_digest and mod_proxy), CherryPy only receives these headers, and there is no username...

Request Headers:
X-FORWARDED-SERVER: local
REFERER: http://local/index
ACCEPT-LANGUAGE: en
HOST: localhost:8080
ACCEPT: */*
USER-AGENT: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
CONNECTION: close
Remote-Addr: 127.0.0.1
X-FORWARDED-HOST: local
X-FORWARDED-FOR: 192.168.255.3
ACCEPT-ENCODING: gzip, deflate