| 
20
 | 
     1  | 
These instructions assume that you have the following working
  | 
| 
 | 
     2  | 
together: Web Server, database and Python.  I personnaly used
  | 
| 
 | 
     3  | 
this configuration for my testing.
  | 
| 
 | 
     4  | 
  | 
| 
 | 
     5  | 
- Apache Web Server (http://www.apache.org/).  Currently, the
  | 
| 
 | 
     6  | 
  only to restrict access to your code, is to used the web server
  | 
| 
 | 
     7  | 
  authentification.  With apache, I used the AuthType Basic and
  | 
| 
 | 
     8  | 
  Limit/require instruction for doing so.
  | 
| 
 | 
     9  | 
  | 
| 
 | 
    10  | 
- PostgreSQL (http://www.postgresql.org).  I try to make my code
  | 
| 
 | 
    11  | 
  SQL-92 compliant but currently, only test it on PostgreSQL.  The
  | 
| 
 | 
    12  | 
  code can show strange behavior and be corrupt especially if your
  | 
| 
 | 
    13  | 
  server doesn't support transaction on UPDATE.  Also, the DB must
  | 
| 
 | 
    14  | 
  have a Python DBAPI-2.0 interface.
  | 
| 
 | 
    15  | 
  | 
| 
 | 
    16  | 
- Python (http://www.python.org).  I used a python installation 2.1
  | 
| 
 | 
    17  | 
  with some basic modules:
  | 
| 
 | 
    18  | 
  - htmltmpl (http://htmltmpl.sourceforge.net/).  A simple HTML
  | 
| 
 | 
    19  | 
    template system.  I always think I should upgrade to a more
  | 
| 
 | 
    20  | 
    powerful one but htmltmpl really simply do the job.
  | 
| 
 | 
    21  | 
  - pygresql (http://www.pygresql.org/).  A Python DBAPI-2.0
  | 
| 
 | 
    22  | 
    interface to postgresql.  I think any other DBAPI-2.0 compliant
  | 
| 
 | 
    23  | 
    module will do it with only small modifications.
  | 
| 
 | 
    24  | 
  | 
| 
 | 
    25  | 
--
  | 
| 
 | 
    26  | 
xbelweb installation
  | 
| 
 | 
    27  | 
(after untar/unzip the distribution file to a temporary location...)
  | 
| 
 | 
    28  | 
  | 
| 
 | 
    29  | 
1. Move the python code into a repertory where the web server will serve
  | 
| 
 | 
    30  | 
   the CGI.
  | 
| 
 | 
    31  | 
  | 
| 
 | 
    32  | 
2. Tell the web server to serve only CGI .py from the root directory
  | 
| 
 | 
    33  | 
   of the application.  The lib and inc directory content should not
  | 
| 
 | 
    34  | 
   be used.  Add any authorization you need.
  | 
| 
 | 
    35  | 
  | 
| 
 | 
    36  | 
3. Create a database for xbelweb (e.g., "xbelweb"), then create the
  | 
| 
 | 
    37  | 
   tables in the database used by xbelweb using the
  | 
| 
 | 
    38  | 
   ./lib/db/create_db.[your database] definition.  I do it with
  | 
| 
 | 
    39  | 
   psql -U php < create_db.postgresql
  | 
| 
 | 
    40  | 
  | 
| 
 | 
    41  | 
4. Update the lib/config.py file to reflect your db configuration.
  | 
| 
 | 
    42  | 
  | 
| 
 | 
    43  | 
  |