1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
Install instructions for DHIS server rel5.2
===========================================
dhisd is the DHIS server, meant to permit updating external
databases with dynamically assiged IP addresses to clients.
In order to build the dhisd server the following requirements must
be met:
The machine must be permanently connected to the internet
with a static IP address.
The machine which will act as a server should be running
a distribution of UNIX or similar system.
A C compiler is needed.
The GNU Multi Precision library is required (see section 0 below).
0. GMP
======
Before starting to compile DHISD, the GNU MultiPrecision library gmp
must be installed.
It may be downloaded from:
ftp://ftp.dhis.org/pub/dhis/gmp-4.1.tar.gz
Decompressed. Building should require:
./configure
make
make install
1. Compile Stage
----------------
If your system is System V based, edit the Makefile and add
-lsocket -lnsl to the LIBS section. These are required
for TCP/IP operation.
Being in the source directory type "make".
It should build the dhisd binary.
2. Install stage
----------------
In this installation we will use /etc/dhis as the default
base directory for the server. Another directory may be
used in which case file location command line options must
be given to dhisd when executing.
Create the directories:
/etc/dhis
/etc/dhis/bin
/etc/dhis/pid
/etc/dhis/db
/etc/dhis/log
You may wish to create /etc/dhis/src and put dhisd-5.2 under
this directory.
Copy dhisd to /etc/dhis/bin . This is the server binary.
Create the database file which will hold information for
current dynamic hosts:
Change directory to /etc/dhis/db
Create a text file named dhis.db with a text editor.
Each dynamic host in the database file is represented by
a record in the following form:
ID {
authentication keys
}
Example: 3 hosts, 2 with password authentication and 1 with
QRC authentication.
dhis.db:
--------
1000 {
HostPass secret1
Service serviceA
}
1001 {
HostPass secret2
Service serviceA
}
1002 {
AuthN 62618356157083313953659443711837574706224086057551
AuthN 20427737733677817431836864820217527591008711003863
AuthN 70979542582114024334017868024554473396638523106022
AuthN 2702375049521348659606361903688258217224352016237
Service serviceA
Service serviceB
}
A dynamic record starts with a { and ends with a }.
The hostid is a unique number that identifies the client.
HostPass is the text password that the client uses to authenticate.
AuthN is the client's public key if QRC is being used.
Please note that either hostpass or authn must be present
for each host but they may not be used together.
QRC keys may be generated with the genkeys utility provided
in this distribution. Run genkeys and copy-paste the
AuthN lines. AuthP and AuthQ lines are the client's private
keys and should be sent to the client wishing to authenticate
using QRC.
authn is the client's public key. It may be represented
as a series of authn lines in which case the digits
are concatenated in appearance order originating a
bigger public key.
Service represents the services/modules that the client subscribes
to. See MODULES for more information.
Any line inside a record that does not have a known keyword
is discarded and thus, may be used as a comment or additional
information.
Keywords are case insensitive thus AuthN is the same as authn.
Please note that R3 clients should use password (and hostpass)
and not QRC. The authentication sequence is different but
the same keywords serves both purposes i.e., password
in R3 and R4/R5.
As of R5 the file dhisd no longer requires a hostname keyword.
This is because the DHIS server is no longer DNS service
specific. For a DNS service the dns engine should implement
a matrix for translation between hostid and hostname.
Since dhisd ignores anything that does not match an implemented
command the dhis.db file may be used by engines to contain
additional information.
1003 uses QRC and has the public key resulting
from concatenating the number sequence.
For each new dynamic host added, kill -HUP the dhisd process
for database reloading.
Change the permissions as you wish. In particular dhis.db
should not be readable by anyone. Suggested example:
chmod 700 /etc/dhis /etc/dhis/*
chmod 600 /etc/dhis/db/dhis.db
Add dhisd to your system's startup script
(rc.local for BSD systems, SXXdhis under /etc/rc2.d
for System V). A simple line such as
/etc/dhis/bin/dhisd
will do.
Now create /etc/dhis/db/services.db
Insert one line per module implemented. See MODULES
for a detailed description of the modular architecture
and services.db format.
And the DHIS server is installed.
See the README file for more information on the server
and MODULES for information on the new modular structure
of the server.
You may also run /etc/dhis/bin/dhisd now if you wish to
run DHIS at once.
3. Adding Records
-----------------
For each new host, as described above, a new record must be
added to dhis.db and a kill -HUP must be sent to the dhisd process.
4. Running dhisd in debug mode
------------------------------
The DHIS server dhisd may be configured to log DEBUG messages
to syslog.
Currently most messages are logged under LOG_DEBUG so
a proper log file specified in syslog.conf is required.
By default dhisd does not log much.
Currently most information will be dumped on level 1
and only one function will log on level 2.
There are two ways of turning debugging on:
1) Use the -D option
To log on level 1 use dhisd -D
To log on level 2 use dhisd -D -D
2) Using SIGUSR1 and SIGUSR2 dhisd can be configured
at run time to increase or reset its log level.
Sengind a SIGURS1 to the dhisd process increases its log
level by one. Sending a SIGUSR2 to the process resets
the log level to 0.
And that's it. The DHIS server is installed.
|