samer@7
|
1 #!/usr/local/bin/swipl
|
samer@7
|
2
|
samer@7
|
3 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
samer@7
|
4 ClioPatria is prepared to be combined with the SWI-Prolog library
|
samer@7
|
5 library(http/http_unix_daemon). ClioPatria is started as a deamon
|
samer@7
|
6 using
|
samer@7
|
7
|
samer@7
|
8 % ./daemon.pl --port=Port [option ...]
|
samer@7
|
9
|
samer@7
|
10 Options are briefly described by running the daemon with --help:
|
samer@7
|
11
|
samer@7
|
12 % ./daemon.pl --help
|
samer@7
|
13
|
samer@7
|
14 See library(http/http_unix_daemon) for details. The SWI-Prolog
|
samer@7
|
15 distribution contains a file debian-init-script, which can be
|
samer@7
|
16 used as a skeleton for managing the server from /etc/init.d. To
|
samer@7
|
17 do so, follow these steps:
|
samer@7
|
18
|
samer@7
|
19 1. copy debian-init-script to /etc/init.d/<server>. This
|
samer@7
|
20 script is in the directory doc/packages/examples/http of
|
samer@7
|
21 your Prolog installation.
|
samer@7
|
22 2. Edit /etc/init.d/<server>, setting DIR to the working
|
samer@7
|
23 directory of the ClioPatria server.
|
samer@7
|
24 3. Edit the remainder of the configuration section to suit
|
samer@7
|
25 your needs.
|
samer@7
|
26 4. Run
|
samer@7
|
27 % update-rc.d <server> defaults
|
samer@7
|
28 % /etc/init.d/<server> start
|
samer@7
|
29
|
samer@7
|
30 Permissions
|
samer@7
|
31
|
samer@7
|
32 Ideally, the ClioPatria directory is owned by another user than the user
|
samer@7
|
33 used by the daemon. If the user of the daemon has no write access, it
|
samer@7
|
34 acts as a read-only service. Write access may be given by changing the
|
samer@7
|
35 group of certain files to the group of the daemon and allowing group
|
samer@7
|
36 write. You may want to add write access to
|
samer@7
|
37
|
samer@7
|
38 - The RDF-store directory to allow adding persistent triples (otherwise
|
samer@7
|
39 tiples may be added, but will not persist).
|
samer@7
|
40 - The file settings.db to allow changing settings through the API.
|
samer@7
|
41 - The file users.db to allow modifying the user database throuh th API
|
samer@7
|
42 - The '.' directory to allow creating httpd.log.
|
samer@7
|
43 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
samer@7
|
44
|
samer@7
|
45 :- set_prolog_flag(verbose, silent).
|
samer@7
|
46 :- use_module(library(http/http_unix_daemon)).
|
samer@7
|
47 :- [run].
|