]> arthur.barton.de Git - ngircd-alex.git/blob - INSTALL.md
788c2349bee817cb212f7617c3af7558b1613264
[ngircd-alex.git] / INSTALL.md
1 # [ngIRCd](https://ngircd.barton.de) - Internet Relay Chat Server
2
3 This document explains how to install ngIRCd, the lightweight Internet Relay
4 Chat (IRC) server.
5
6 The first section lists noteworthy changes to earlier releases; you definitely
7 should read this when upgrading your setup! But you can skip over this section
8 when you do a fresh installation.
9
10 All the subsequent sections describe the steps required to install and
11 configure ngIRCd.
12
13 ## Upgrade Information
14
15 Differences to version 22.x
16
17 - The *NoticeAuth* `ngircd.conf` configuration variable has been renamed to
18   *NoticeBeforeRegistration*. The old *NoticeAuth* variable still works but
19   is deprecated now.
20
21 - The default value of the SSL *CipherList* variable has been changed to
22   "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0"
23   (GnuTLS) to disable the old SSLv3 protocol by default.
24
25   To enable connections of clients still requiring the weak SSLv3 protocol,
26   the *CipherList* must be set to its old value (not recommended!), which
27   was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below.
28
29 Differences to version 20.x
30
31 - Starting with ngIRCd 21, the ciphers used by SSL are configurable and
32   default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS).
33   Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT"
34   and "NORMAL" respectively.
35
36 - When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching
37   the new mask will be KILL'ed. This was not the case with earlier versions
38   that only added the mask but didn't kill already connected users.
39
40 - The *PredefChannelsOnly* configuration variable has been superseded by the
41   new *AllowedChannelTypes* variable. It is still supported and translated to
42   the appropriate *AllowedChannelTypes* setting but is deprecated now.
43
44 Differences to version 19.x
45
46 - Starting with ngIRCd 20, users can "cloak" their hostname only when the
47   configuration variable *CloakHostModeX* (introduced in 19.2) is set.
48   Otherwise, only IRC operators, other servers, and services are allowed to
49   set mode +x. This prevents regular users from changing their hostmask to
50   the name of the IRC server itself, which confused quite a few people ;-)
51
52 Differences to version 17.x
53
54 - Support for ZeroConf/Bonjour/Rendezvous service registration has been
55   removed. The configuration option *NoZeroconf* is no longer available.
56
57 - The structure of `ngircd.conf` has been cleaned up and three new configuration
58   sections have been introduced: *[Limits]*, *[Options]*, and *[SSL]*.
59
60   Lots of configuration variables stored in the *[Global]* section are now
61   deprecated there and should be stored in one of these new sections (but
62   still work in *[Global]*):
63
64   - *AllowRemoteOper*    -> [Options]
65   - *ChrootDir*          -> [Options]
66   - *ConnectIPv4*        -> [Options]
67   - *ConnectIPv6*        -> [Options]
68   - *ConnectRetry*       -> [Limits]
69   - *MaxConnections*     -> [Limits]
70   - *MaxConnectionsIP*   -> [Limits]
71   - *MaxJoins*           -> [Limits]
72   - *MaxNickLength*      -> [Limits]
73   - *NoDNS*              -> [Options], and renamed to *DNS*
74   - *NoIdent*            -> [Options], and renamed to *Ident*
75   - *NoPAM*              -> [Options], and renamed to *PAM*
76   - *OperCanUseMode*     -> [Options]
77   - *OperServerMode*     -> [Options]
78   - *PingTimeout*        -> [Limits]
79   - *PongTimeout*        -> [Limits]
80   - *PredefChannelsOnly* -> [Options]
81   - *SSLCertFile*        -> [SSL], and renamed to *CertFile*
82   - *SSLDHFile*          -> [SSL], and renamed to *DHFile*
83   - *SSLKeyFile*         -> [SSL], and renamed to *KeyFile*
84   - *SSLKeyFilePassword* -> [SSL], and renamed to *KeyFilePassword*
85   - *SSLPorts*           -> [SSL], and renamed to *Ports*
86   - *SyslogFacility*     -> [Options]
87   - *WebircPassword*     -> [Options]
88
89   You should adjust your `ngircd.conf` and run `ngircd --configtest` to make
90   sure that your settings are correct and up to date!
91
92 Differences to version 16.x
93
94 - Changes to the *MotdFile* specified in `ngircd.conf` now require a ngIRCd
95   configuration reload to take effect (HUP signal, *REHASH* command).
96
97 Differences to version 0.9.x
98
99 - The option of the configure script to enable support for Zeroconf/Bonjour/
100   Rendezvous/WhateverItIsNamedToday has been renamed:
101
102   - `--with-rendezvous`  ->  `--with-zeroconf`
103
104 Differences to version 0.8.x
105
106 - The maximum length of passwords has been raised to 20 characters (instead
107   of 8 characters). If your passwords are longer than 8 characters then they
108   are cut at an other position now.
109
110 Differences to version 0.6.x
111
112 - Some options of the configure script have been renamed:
113
114   - `--disable-syslog`  ->  `--without-syslog`
115   - `--disable-zlib`    ->  `--without-zlib`
116
117   Please call `./configure --help` to review the full list of options!
118
119 Differences to version 0.5.x
120
121 - Starting with version 0.6.0, other servers are identified using asynchronous
122   passwords: therefore the variable *Password* in *[Server]*-sections has been
123   replaced by *MyPassword* and *PeerPassword*.
124
125 - New configuration variables, section *[Global]*: *MaxConnections*, *MaxJoins*
126   (see example configuration file `doc/sample-ngircd.conf`!).
127
128 ## Standard Installation
129
130 *Note*: This sections describes installing ngIRCd *from sources*. If you use
131 packages available for your operating system distribution you should skip over
132 and continue with the *Configuration* section, see below.
133
134 ngIRCd is developed for UNIX-based systems, which means that the installation
135 on modern UNIX-like systems that are supported by GNU autoconf and GNU
136 automake ("`configure` script") should be no problem.
137
138 The normal installation procedure after getting (and expanding) the source
139 files (using a distribution archive or Git) is as following:
140
141 1) Satisfy prerequisites
142 2) `./autogen.sh` [only necessary when using "raw" sources with Git]
143 3) `./configure`
144 4) `make`
145 5) `make install`
146
147 (Please see details below!)
148
149 Now the newly compiled executable "ngircd" is installed in its standard
150 location, `/usr/local/sbin/`.
151
152 If no previous version of the configuration file exists (the standard name
153 is `/usr/local/etc/ngircd.conf)`, a sample configuration file containing all
154 possible options will be installed there. You'll find its template in the
155 `doc/` directory: `sample-ngircd.conf`.
156
157 The next step is to configure and afterwards start the daemon. See the section
158 *Configuration* below.
159
160 ### Satisfy prerequisites
161
162 When building from source, you'll need some other software to build ngIRCd:
163 for example a working C compiler, make tool, and a few libraries depending on
164 the feature set you want to enable at compile time (like IDENT, SSL, and PAM).
165
166 And if you aren't using a distribution archive ("tar.gz" file), but cloned the
167 plain source archive, you need a few additional tools to generate the build
168 system itself: GNU automake and autoconf, as well as pkg-config.
169
170 If you are using one of the "big" operating systems or Linux distributions,
171 you can use the following commands to install all the required packages to
172 build the sources including all optional features and to run the test suite:
173
174 #### Red Hat / Fedora based distributions
175
176 ``` shell
177   yum install \
178     autoconf automake expect gcc glibc-devel gnutls-devel \
179     libident-devel make pam-devel pkg-config tcp_wrappers-devel \
180     telnet zlib-devel
181 ```
182
183 #### Debian / Ubuntu based distributions
184
185 ``` shell
186   apt-get install \
187     autoconf automake build-essential expect libgnutls28-dev \
188     libident-dev libpam-dev pkg-config libwrap0-dev libz-dev telnet
189 ```
190
191 ### `./autogen.sh`
192
193 The first step, to run `./autogen.sh`, is *only* necessary if the `configure`
194 script itself isn't already generated and available. This never happens in
195 official ("stable") releases in "tar.gz" archives, but when cloning the source
196 code repository using Git.
197
198 **This step is therefore only interesting for developers!**
199
200 The `autogen.sh` script produces the `Makefile.in`'s, which are necessary for
201 the configure script itself, and some more files for `make(1)`.
202
203 To run `autogen.sh` you'll need GNU autoconf, GNU automake and pkg-config: at
204 least autoconf 2.61 and automake 1.10 are required, newer is better. But don't
205 use automake 1.12 or newer for creating distribution archives: it will work
206 but lack "de-ANSI-fication" support in the generated Makefile's! Stick with
207 automake 1.11.x for this purpose ...
208
209 So *automake 1.11.x* and *autoconf 2.67+* is recommended.
210
211 Again: "end users" do not need this step and neither need GNU autoconf nor GNU
212 automake at all!
213
214 ### `./configure`
215
216 The `configure` script is used to detect local system dependencies.
217
218 In the perfect case, `configure` should recognize all needed libraries, header
219 files and so on. If this shouldn't work, `./configure --help` shows all
220 possible options.
221
222 In addition, you can pass some command line options to `configure` to enable
223 and/or disable some features of ngIRCd. All these options are shown using
224 `./configure --help`, too.
225
226 Compiling a static binary will avoid you the hassle of feeding a chroot dir
227 (if you want use the chroot feature). Just do something like:
228
229 ``` shell
230   CFLAGS=-static ./configure [--your-options ...]
231 ```
232
233 Then you can use a void directory as ChrootDir (like OpenSSH's `/var/empty`).
234
235 ### `make`
236
237 The `make(1)` command uses the `Makefile`'s produced by `configure` and
238 compiles the ngIRCd daemon.
239
240 ### `make install`
241
242 Use `make install` to install the server and a sample configuration file on
243 the local system. Normally, root privileges are necessary to complete this
244 step. If there is already an older configuration file present, it won't be
245 overwritten.
246
247 These files and folders will be installed by default:
248
249 - `/usr/local/sbin/ngircd`: executable server
250 - `/usr/local/etc/ngircd.conf`: sample configuration (if not already present)
251 - `/usr/local/share/doc/ngircd/`: documentation
252 - `/usr/local/share/man/`: manual pages
253
254 ### Additional features
255
256 The following optional features can be compiled into the daemon by passing
257 options to the `configure` script. Most options can handle a `<path>` argument
258 which will be used to search for the required libraries and header files in
259 the given paths (`<path>/lib/...`, `<path>/include/...`) in addition to the
260 standard locations.
261
262 - Syslog Logging (autodetected by default):
263
264   `--with-syslog[=<path>]` / `--without-syslog`
265
266   Enable (disable) support for logging to "syslog", which should be
267   available on most modern UNIX-like operating systems by default.
268
269 - ZLib Compression (autodetected by default):
270
271   `--with-zlib[=<path>]` / `--without-zlib`
272
273   Enable (disable) support for compressed server-server links.
274   The Z compression library ("libz") is required for this option.
275
276 - IO Backend (autodetected by default):
277
278   - `--with-select[=<path>]` / `--without-select`
279   - `--with-poll[=<path>]` / `--without-poll`
280   - `--with-devpoll[=<path>]` / `--without-devpoll`
281   - `--with-epoll[=<path>]` / `--without-epoll`
282   - `--with-kqueue[=<path>]` / `--without-kqueue`
283
284   ngIRCd can use different IO "backends": the "old school" `select(2)` and
285   `poll(2)` API which should be supported by most UNIX-like operating systems,
286   or the more efficient and flexible `epoll(7)` (Linux >=2.6), `kqueue(2)`
287   (BSD) and `/dev/poll` APIs.
288
289   By default the IO backend is autodetected, but you can use `--without-xxx`
290   to disable a more enhanced API.
291
292   When using the `epoll(7)` API, support for `select(2)` is compiled in as
293   well by default, to enable the binary to run on older Linux kernels (<2.6),
294   too.
295
296 - IDENT-Support:
297
298   `--with-ident[=<path>]`
299
300   Include support for IDENT ("AUTH") lookups. The "ident" library is
301   required for this option.
302
303 - TCP-Wrappers:
304
305   `--with-tcp-wrappers[=<path>]`
306
307   Include support for Wietse Venemas "TCP Wrappers" to limit client access
308   to the daemon, for example by using `/etc/hosts.{allow|deny}`.
309   The "libwrap" is required for this option.
310
311 - PAM:
312
313   `--with-pam[=<path>]`
314
315   Enable support for PAM, the Pluggable Authentication Modules library.
316   See `doc/PAM.txt` for details.
317
318 - SSL:
319
320   - `--with-openssl[=<path>]`
321   - `--with-gnutls[=<path>]`
322
323   Enable support for SSL/TLS using OpenSSL or GnuTLS libraries.
324   See `doc/SSL.txt` for details.
325
326 - IPv6:
327
328   `--enable-ipv6`
329
330   Adds support for version 6 of the Internet Protocol.
331
332 ## Configuration
333
334 Please have a look at the `ngircd(8)` and `ngircd.conf(5)` manual pages for
335 details and all possible command line and configuration options -- **and don't
336 forget to run `ngircd --configtest` to validate your configuration file!**
337
338 After installing ngIRCd, a sample configuration file will be set up (if it
339 does not exist already). By default, when installing from sources, the file is
340 named `/usr/local/etc/ngircd.conf` (other common names, especially for
341 distribution packages, are `/etc/ngircd.conf` or `/etc/ngircd/ngircd.conf`).
342
343 You can find the template of the sample configuration file in the `doc/`
344 directory as `sample-ngircd.conf` and
345 [online](https://ngircd.barton.de/doc/sample-ngircd.conf) on the homepage. It
346 contains all available options.
347
348 In the sample configuration file, there are comments beginning with `#` *or*
349 `;` -- this is only for the better understanding of the file, both comment
350 styles are equal.
351
352 The file is separated in five blocks: *[Global]*, *[Features]*, *[Operator]*,
353 *[Server]*, and *[Channel]*.
354
355 In the *[Global]* section, there is the main configuration like the server
356 name and the ports, on which the server should be listening. Options in
357 the *[Features]* section enable or disable functionality in the daemon.
358 IRC operators of this server are defined in *[Operator]* blocks, remote
359 servers are configured in *[Server]* sections, and *[Channel]* blocks are
360 used to configure pre-defined ("persistent") IRC channels.
361
362 ### Manual Pages Online
363
364 - Daemon: [ngircd.8](https://manpages.debian.org/ngircd.8)
365 - Configutation file: [ngircd.conf.5](https://manpages.debian.org/ngircd.conf.5)
366
367 ## Command line options
368
369 ngIRCd supports the following command line options:
370
371 - `-f`, `--config <file>`
372
373   The daemon uses the file `<file>` as configuration file rather than
374   the standard configuration `/usr/local/etc/ngircd.conf`.
375
376 - `-n`, `--nodaemon`
377
378   ngIRCd should be running as a foreground process.
379
380 - `-p`, `--passive`
381
382   Server-links won't be automatically established.
383
384 - `-t`, `--configtest`
385
386   Reads, validates and dumps the configuration file as interpreted
387   by the server. Then exits.
388
389 Use `--help` to see a short help text describing all available parameters
390 the server understands, with `--version` the ngIRCd shows its version
391 number. In both cases the server exits after the output.
392
393 Please see the `ngircd(8)` manual page for more details!