paulb@35 | 1 | Webware's CGI adapter:
|
paulb@35 | 2 |
|
paulb@35 | 3 | Copy the Webware/WebKit/Adapters/WebKit.cgi file to your CGI directory (eg.
|
paulb@35 | 4 | /home/httpd/cgi-bin), then add a line like this to httpd.conf:
|
paulb@35 | 5 |
|
paulb@35 | 6 | ScriptAlias /webkit "/home/httpd/cgi-bin/WebKit.cgi"
|
paulb@35 | 7 |
|
paulb@35 | 8 | --------
|
paulb@35 | 9 |
|
paulb@35 | 10 | For Webware releases beyond 0.8.1:
|
paulb@35 | 11 |
|
paulb@35 | 12 | WebStack applications are supported as contexts within WebKit, meaning that a
|
paulb@35 | 13 | certain prefix in the URL determines whether an application is sent a
|
paulb@35 | 14 | particular request.
|
paulb@35 | 15 |
|
paulb@35 | 16 | Each context must be defined in the Webware/WebKit/Configs/Application.config
|
paulb@35 | 17 | file within the 'Contexts' dictionary entry; for example:
|
paulb@35 | 18 |
|
paulb@44 | 19 | 'simple': '/home/paulb/Software/Python/WebStack/examples/Webware/SimpleContext',
|
paulb@35 | 20 |
|
paulb@35 | 21 | Note that the path to the context directory must be absolute, although the
|
paulb@35 | 22 | context directory may reside within WebKit itself such that the path may then
|
paulb@35 | 23 | make use of the special %(WebKitPath)s substitution.
|
paulb@35 | 24 |
|
paulb@44 | 25 | Note also that the name of the context (eg. 'simple') must not be the same as
|
paulb@44 | 26 | the name of any other package used within the application (and possibly any
|
paulb@44 | 27 | other applications in the application server), with the only reasonable
|
paulb@44 | 28 | exception being the context package name itself (eg. 'SimpleContext').
|
paulb@44 | 29 | Otherwise, the existing package will become overridden by the contents of the
|
paulb@44 | 30 | context itself. Therefore, given that the Simple package is used to hold the
|
paulb@44 | 31 | actual application code, it is not wise to use 'Simple' as the context name.
|
paulb@44 | 32 |
|
paulb@35 | 33 | Running the application server:
|
paulb@35 | 34 |
|
paulb@35 | 35 | Change into the WebKit directory within Webware. Then, specifying the
|
paulb@35 | 36 | appropriate PYTHONPATH, invoke the application server. For example:
|
paulb@35 | 37 |
|
paulb@35 | 38 | PYTHONPATH=../../../WebStack:../../../WebStack/examples/Common ./AppServer
|
paulb@35 | 39 |
|
paulb@35 | 40 | The WebStack package must reside on the PYTHONPATH, along with the package
|
paulb@35 | 41 | containing the application itself.
|
paulb@35 | 42 |
|
paulb@35 | 43 | --------
|
paulb@35 | 44 |
|
paulb@35 | 45 | For Webware 0.8.1 or earlier:
|
paulb@35 | 46 |
|
paulb@35 | 47 | Support for WebStack applications is provided by a Webware plug-in which
|
paulb@35 | 48 | associates Webware resources having certain suffixes with certain WebStack
|
paulb@35 | 49 | applications, regardless of the context within which a resource appears. In
|
paulb@35 | 50 | order to make use of such a scheme, a WebStack application would have its
|
paulb@35 | 51 | resources residing in an arbitrary URL "hierarchy", but with each resource
|
paulb@35 | 52 | having the special suffix to indicate that it belongs to that application.
|
paulb@35 | 53 |
|
paulb@35 | 54 | In the case of an application whose chosen suffix is ".xyz", it would be
|
paulb@35 | 55 | possible, for example, to define resources residing at the following URL
|
paulb@35 | 56 | paths:
|
paulb@35 | 57 |
|
paulb@35 | 58 | tasks/my-tasks.xyz
|
paulb@35 | 59 | tasks/outstanding/urgent.xyz
|
paulb@35 | 60 | agenda/today.xyz
|
paulb@35 | 61 |
|
paulb@35 | 62 | This is somewhat counter-intuitive to typical Webware concepts, and it is
|
paulb@35 | 63 | recommended that Webware releases beyond 0.8.1 are used together with the
|
paulb@35 | 64 | appropriate WebStack context mechanisms instead of using this plug-in scheme.
|
paulb@35 | 65 |
|
paulb@35 | 66 | In order to support such behaviour, the patches in the
|
paulb@35 | 67 | WebStack/patches/Webware/WebKit directory must be applied to WebKit:
|
paulb@35 | 68 |
|
paulb@35 | 69 | cd Webware/WebKit
|
paulb@35 | 70 | patch -p0 < ../../WebStack/patches/Webware/WebKit/Application.py-0.8.1.diff
|
paulb@35 | 71 | patch -p0 < ../../WebStack/patches/Webware/WebKit/HTTPRequest.py-0.8.1.diff
|
paulb@35 | 72 |
|
paulb@35 | 73 | Each plug-in, representing a WebStack application, should be visible in the
|
paulb@35 | 74 | Webware root directory. A symbolic link can be used to make each example
|
paulb@35 | 75 | appear; the Simple application being installed as follows:
|
paulb@21 | 76 |
|
paulb@21 | 77 | cd Webware
|
paulb@40 | 78 | ln -s ../WebStack/examples/Webware/SimpleApp
|
paulb@21 | 79 |
|
paulb@35 | 80 | Running the application server:
|
paulb@35 | 81 |
|
paulb@19 | 82 | Change into the WebKit directory within Webware. Then, specifying the
|
paulb@19 | 83 | appropriate PYTHONPATH, invoke the application server. For example:
|
paulb@19 | 84 |
|
paulb@19 | 85 | PYTHONPATH=../../WebStack:../../WebStack/examples/Common ./AppServer
|
paulb@19 | 86 |
|
paulb@19 | 87 | The WebStack package must reside on the PYTHONPATH, along with the package
|
paulb@19 | 88 | containing the application itself.
|