@@ -38,27 +38,37 @@ Example apache config
3838---------------------
3939Below is part of an apache configuration file. The first part loads
4040the module.
41- The Location directive makes the /tautoru url under control of the okioki module.
42- - The OkiokiConnectionInfo shows a postgresql connect string.
43- - The OkiokiCommand gives http method, a regex url (under /tautoru) and optionally decoded argument names.
44- - The OkiokiSQL sets the SQL statement to execute when the command matches, it also optionally
45- allows for named SQL parameters (which are decoded from the url, query string, post parameter and cookies).
46- - The OkiokiCSV sets the names (which matches the names in the select clause) of the columns to display.
41+
42+ - Use of DBD commands to prepare the sql statements and use a resource pool
43+ - Use of the Rewrite engine to convert RESTful URLs to simple urls.
44+ - The OkiokiCommand has assigned to it:
45+ * a http method,
46+ * an url (under /tautoru),
47+ * That the result should be returned in CSV form,
48+ * the prepared statement to use,
49+ * and the parameters from a GET/POST form, to be used with the prepared statement
4750
4851<IfModule !mod_okioki.c>
4952 LoadModule okioki_module modules/mod_okioki.so
5053</IfModule>
5154
52- <Location /tautoru>
53- SetHandler okioki-handler
54- OkiokiConnectionInfo "host=localhost dbname=tautoru user=tautoru password=foobarbaz"
55+ <VirtualHost *:80>
56+ DBDriver pgsql
57+ DBDParams "host=localhost dbname=tautoru user=tautoru password=xxxxxx"
58+
59+ DBDPrepareSQL "select id, name from otp_algorithm;" sql_test
60+ DBDPrepareSQL "select name from otp_algorithm where id = %hhd;" sql_test_id
61+
62+ #RewriteLog "/var/log/apache2/rewrite.log"
63+ #RewriteLogLevel 9
5564
56- OkiokiCommand GET ^/test$
57- OkiokiSQL "select id, name from otp_algorithm"
58- OkiokiCSV id name
65+ RewriteEngine on
66+ RewriteRule ^/tautoru/test/(.*) /tautoru/test_id?id=$1
5967
60- OkiokiCommand GET ^/test/([0-9]+)$ id
61- OkiokiSQL "select name from otp_algorithm where id = $1" id
62- OkiokiCSV name
63- </Location>
68+ <Location /tautoru>
69+ SetHandler okioki-handler
70+ OkiokiCommand GET /test CSV sql_test
71+ OkiokiCommand GET /test_id CSV sql_test_id id
72+ </Location>
73+ </VirtualHost>
6474
0 commit comments