]> granicus.if.org Git - icinga2/blob - doc/2-getting-started.md
Documentation: Reorganize Livestatus and alternative Frontends
[icinga2] / doc / 2-getting-started.md
1 # <a id="getting-started"></a> Getting Started
2
3 This tutorial is a step-by-step introduction to installing [Icinga 2](2-getting-started.md#setting-up-icinga2)
4 and [Icinga Web 2](2-getting-started.md#setting-up-the-user-interface).
5 It assumes that you are familiar with the operating system you're using to install Icinga 2.
6
7 ## <a id="setting-up-icinga2"></a> Setting up Icinga 2
8
9 First off you will have to install Icinga 2. The preferred way of doing this
10 is to use the official package repositories depending on which operating system
11 and distribution you are running.
12
13   Distribution            | Repository
14   ------------------------|---------------------------
15   Debian                  | [debmon](http://debmon.org/packages/debmon-jessie/icinga2), [Icinga Repository](http://packages.icinga.org/debian/)
16   Ubuntu                  | [Icinga PPA](https://launchpad.net/~formorer/+archive/ubuntu/icinga), [Icinga Repository](http://packages.icinga.org/ubuntu/)
17   RHEL/CentOS             | [Icinga Repository](http://packages.icinga.org/epel/)
18   openSUSE                | [Icinga Repository](http://packages.icinga.org/openSUSE/), [Server Monitoring Repository](https://build.opensuse.org/package/show/server:monitoring/icinga2)
19   SLES                    | [Icinga Repository](http://packages.icinga.org/SUSE/)
20   Gentoo                  | [Upstream](http://packages.gentoo.org/package/net-analyzer/icinga2)
21   FreeBSD                 | [Upstream](http://www.freshports.org/net-mgmt/icinga2)
22   ArchLinux               | [Upstream](https://aur.archlinux.org/packages/icinga2)
23
24 Packages for distributions other than the ones listed above may also be
25 available. Please contact your distribution packagers.
26
27 ### <a id="package-repositories"></a> Package Repositories
28
29 You need to add the Icinga repository to your package management configuration.
30 Below is a list with examples for the various distributions.
31
32 Debian (debmon):
33
34     # wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -
35     # echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list
36     # apt-get update
37
38 Ubuntu (PPA):
39
40     # add-apt-repository ppa:formorer/icinga
41     # apt-get update
42
43 RHEL/CentOS:
44
45     # rpm --import http://packages.icinga.org/icinga.key
46     # curl -o /etc/yum.repos.d/ICINGA-release.repo http://packages.icinga.org/epel/ICINGA-release.repo
47     # yum makecache
48
49 The packages for RHEL/CentOS depend on other packages which are distributed
50 as part of the [EPEL repository](http://fedoraproject.org/wiki/EPEL). Please
51 make sure to enable this repository by following
52 [these instructions](http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
53
54 Fedora:
55
56     # rpm --import http://packages.icinga.org/icinga.key
57     # curl -o /etc/yum.repos.d/ICINGA-release.repo http://packages.icinga.org/fedora/ICINGA-release.repo
58     # yum makecache
59
60 SLES 11:
61
62     # zypper ar http://packages.icinga.org/SUSE/ICINGA-release-11.repo
63     # zypper ref
64
65 The packages for SLES 11 depend on the `openssl1` package which is distributed
66 as part of the [SLES 11 Security Module](https://www.suse.com/communities/conversations/introducing-the-suse-linux-enterprise-11-security-module/).
67
68 SLES 12:
69
70     # zypper ar http://packages.icinga.org/SUSE/ICINGA-release.repo
71     # zypper ref
72
73 openSUSE:
74
75     # zypper ar http://packages.icinga.org/openSUSE/ICINGA-release.repo
76     # zypper ref
77
78 ### <a id="installing-icinga2"></a> Installing Icinga 2
79
80 You can install Icinga 2 by using your distribution's package manager
81 to install the `icinga2` package.
82
83 Debian/Ubuntu:
84
85     # apt-get install icinga2
86
87 RHEL/CentOS 5/6:
88
89     # yum install icinga2
90     # chkconfig icinga2 on
91     # service icinga2 start
92
93 RHEL/CentOS 7 and Fedora:
94
95     # yum install icinga2
96     # systemctl enable icinga2
97     # systemctl start icinga2
98
99 SLES/openSUSE:
100
101     # zypper install icinga2
102
103 FreeBSD:
104
105     # pkg install icinga2
106
107 ### <a id="installation-enabled-features"></a> Enabled Features during Installation
108
109 The default installation will enable three features required for a basic
110 Icinga 2 installation:
111
112 * `checker` for executing checks
113 * `notification` for sending notifications
114 * `mainlog` for writing the `icinga2.log` file
115
116 You can verify that by calling `icinga2 feature list`
117 [CLI command](8-cli-commands.md#cli-command-feature) to see which features are
118 enabled and disabled.
119
120     # icinga2 feature list
121     Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog
122     Enabled features: checker mainlog notification
123
124
125 ### <a id="installation-paths"></a> Installation Paths
126
127 By default Icinga 2 uses the following files and directories:
128
129   Path                                | Description
130   ------------------------------------|------------------------------------
131   /etc/icinga2                        | Contains Icinga 2 configuration files.
132   /etc/init.d/icinga2                 | The Icinga 2 init script.
133   /usr/sbin/icinga2                   | The Icinga 2 binary.
134   /usr/share/doc/icinga2              | Documentation files that come with Icinga 2.
135   /usr/share/icinga2/include          | The Icinga Template Library and plugin command configuration.
136   /var/run/icinga2                    | PID file.
137   /var/run/icinga2/cmd                | Command pipe and Livestatus socket.
138   /var/cache/icinga2                  | status.dat/objects.cache, icinga2.debug files
139   /var/spool/icinga2                  | Used for performance data spool files.
140   /var/lib/icinga2                    | Icinga 2 state file, cluster log, local CA and configuration files.
141   /var/log/icinga2                    | Log file location and compat/ directory for the CompatLogger feature.
142
143 FreeBSD uses slightly different paths:
144
145 By default Icinga 2 uses the following files and directories:
146
147   Path                                | Description
148   ------------------------------------|------------------------------------
149   /usr/local/etc/icinga2              | Contains Icinga 2 configuration files.
150   /usr/local/etc/rc.d/icinga2         | The Icinga 2 init script.
151   /usr/local/sbin/icinga2             | The Icinga 2 binary.
152   /usr/local/share/doc/icinga2        | Documentation files that come with Icinga 2.
153   /usr/local/share/icinga2/include    | The Icinga Template Library and plugin command configuration.
154   /var/run/icinga2                    | PID file.
155   /var/run/icinga2/cmd                | Command pipe and Livestatus socket.
156   /var/cache/icinga2                  | status.dat/objects.cache, icinga2.debug files
157   /var/spool/icinga2                  | Used for performance data spool files.
158   /var/lib/icinga2                    | Icinga 2 state file, cluster log, local CA and configuration files.
159   /var/log/icinga2                    | Log file location and compat/ directory for the CompatLogger feature.
160
161 ## <a id="setting-up-check-plugins"></a> Setting up Check Plugins
162
163 Without plugins Icinga 2 does not know how to check external services. The
164 [Monitoring Plugins Project](https://www.monitoring-plugins.org/) provides
165 an extensive set of plugins which can be used with Icinga 2 to check whether
166 services are working properly.
167
168 The recommended way of installing these standard plugins is to use your
169 distribution's package manager.
170
171 For your convenience here is a list of package names for some of the more
172 popular operating systems/distributions:
173
174 OS/Distribution        | Package Name       | Installation Path
175 -----------------------|--------------------|---------------------------
176 RHEL/CentOS (EPEL)     | nagios-plugins-all | /usr/lib/nagios/plugins or /usr/lib64/nagios/plugins
177 Debian                 | nagios-plugins     | /usr/lib/nagios/plugins
178 FreeBSD                | monitoring-plugins | /usr/local/libexec/nagios
179 OS X (MacPorts)        | nagios-plugins     | /opt/local/libexec
180
181 Depending on which directory your plugins are installed into you may need to
182 update the global `PluginDir` constant in your [Icinga 2 configuration](4-configuring-icinga-2.md#constants-conf).
183 This constant is used by the check command definitions contained in the Icinga Template Library
184 to determine where to find the plugin binaries.
185
186 Please refer to the [plugins](14-addons-plugins.md#plugins) chapter for details about how to integrate
187 additional check plugins into your Icinga 2 setup.
188
189 ## <a id="running-icinga2"></a> Running Icinga 2
190
191 ### <a id="init-script"></a> Init Script
192
193 Icinga 2's init script is installed in `/etc/init.d/icinga2` (`/usr/local/etc/rc.d/icinga2` on FreeBSD) by default:
194
195     # /etc/init.d/icinga2
196     Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
197
198 The init script supports the following actions:
199
200   Command             | Description
201   --------------------|------------------------
202   start               | The `start` action starts the Icinga 2 daemon.
203   stop                | The `stop` action stops the Icinga 2 daemon.
204   restart             | The `restart` action is a shortcut for running the `stop` action followed by `start`.
205   reload              | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
206   checkconfig         | The `checkconfig` action checks if the `/etc/icinga2/icinga2.conf` configuration file contains any errors.
207   status              | The `status` action checks if Icinga 2 is running.
208
209 By default the Icinga 2 daemon is running as `icinga` user and group
210 using the init script. Using Debian packages the user and group are set to
211 `nagios` for historical reasons.
212
213 ### <a id="systemd-service"></a> systemd Service
214
215 Some distributions (e.g. Fedora, openSUSE and RHEL/CentOS 7) use systemd. The
216 Icinga 2 packages automatically install the necessary systemd unit files.
217
218 The Icinga 2 systemd service can be (re-)started, reloaded, stopped and also
219 queried for its current status.
220
221     # systemctl status icinga2
222     icinga2.service - Icinga host/service/network monitoring system
223        Loaded: loaded (/usr/lib/systemd/system/icinga2.service; disabled)
224        Active: active (running) since Mi 2014-07-23 13:39:38 CEST; 15s ago
225       Process: 21692 ExecStart=/usr/sbin/icinga2 -c ${ICINGA2_CONFIG_FILE} -d -e ${ICINGA2_ERROR_LOG} -u ${ICINGA2_USER} -g ${ICINGA2_GROUP} (code=exited, status=0/SUCCESS)
226       Process: 21674 ExecStartPre=/usr/sbin/icinga2-prepare-dirs /etc/sysconfig/icinga2 (code=exited, status=0/SUCCESS)
227      Main PID: 21727 (icinga2)
228        CGroup: /system.slice/icinga2.service
229                21727 /usr/sbin/icinga2 -c /etc/icinga2/icinga2.conf -d -e /var/log/icinga2/error.log -u icinga -g icinga --no-stack-rlimit
230
231     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 309 Service(s).
232     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 User(s).
233     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 15 Notification(s).
234     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 4 ScheduledDowntime(s).
235     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 UserGroup(s).
236     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 IcingaApplication(s).
237     Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 8 Dependency(s).
238     Jul 23 13:39:38 nbmif systemd[1]: Started Icinga host/service/network monitoring system.
239
240 The `systemctl` command supports the following actions:
241
242   Command             | Description
243   --------------------|------------------------
244   start               | The `start` action starts the Icinga 2 daemon.
245   stop                | The `stop` action stops the Icinga 2 daemon.
246   restart             | The `restart` action is a shortcut for running the `stop` action followed by `start`.
247   reload              | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
248   status              | The `status` action checks if Icinga 2 is running.
249   enable              | The `enable` action enables the service being started at system boot time (similar to `chkconfig`)
250
251 Examples:
252
253     # systemctl enable icinga2
254
255     # systemctl restart icinga2
256     Job for icinga2.service failed. See 'systemctl status icinga2.service' and 'journalctl -xn' for details.
257
258 If you're stuck with configuration errors, you can manually invoke the
259 [configuration validation](8-cli-commands.md#config-validation).
260
261 ### FreeBSD
262
263 On FreeBSD you need to enable icinga2 in your rc.conf
264
265     # sysrc icinga2_enable=yes
266
267     # service icinga2 restart
268
269 ## <a id="configuration-syntax-highlighting"></a> Configuration Syntax Highlighting
270
271 Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors.
272 The RHEL, SUSE and Debian package `icinga2-common` install these files into
273 `/usr/share/*/icinga2-common/syntax`. Sources provide these files in `tools/syntax`.
274
275 ### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
276
277 Create a new local vim configuration storage, if not already existing.
278 Edit `vim/ftdetect/icinga2.vim` if your paths to the Icinga 2 configuration
279 differ.
280
281     $ PREFIX=~/.vim
282     $ mkdir -p $PREFIX/{syntax,ftdetect}
283     $ cp vim/syntax/icinga2.vim $PREFIX/syntax/
284     $ cp vim/ftdetect/icinga2.vim $PREFIX/ftdetect/
285
286 Test it:
287
288     $ vim /etc/icinga2/conf.d/templates.conf
289
290 ### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
291
292 Copy the `/etc/nanorc` sample file to your home directory. Create the `/etc/nano` directory
293 and copy the provided `icinga2.nanorc` into it.
294
295     $ cp /etc/nanorc ~/.nanorc
296
297     # mkdir -p /etc/nano
298     # cp icinga2.nanorc /etc/nano/
299
300 Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
301
302     $ vim ~/.nanorc
303
304     ## Icinga 2
305     include "/etc/nano/icinga2.nanorc"
306
307 Test it:
308
309     $ nano /etc/icinga2/conf.d/templates.conf
310
311
312 ## <a id="setting-up-the-user-interface"></a> Setting up Icinga Web 2
313
314 Icinga 2 can be used with Icinga Web 2 and a number of other web interfaces.
315 This chapter explains how to set up Icinga Web 2.
316
317 The DB IDO (Database Icinga Data Output) modules for Icinga 2 take care of
318 exporting all configuration and status information into a database. The IDO
319 database is used by a number of projects including
320 [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2), Icinga Reporting
321 or Icinga Web 1.x.
322
323 There is a separate module for each database backend. At present support for
324 both MySQL and PostgreSQL is implemented.
325
326 ### <a id="configuring-db-ido-mysql"></a> Configuring DB IDO MySQL
327
328 #### <a id="installing-database-mysql-server"></a> Installing MySQL database server
329
330 Debian/Ubuntu:
331
332     # apt-get install mysql-server mysql-client
333
334 RHEL/CentOS 5/6:
335
336     # yum install mysql-server mysql
337     # chkconfig mysqld on
338     # service mysqld start
339     # mysql_secure_installation
340
341 RHEL/CentOS 7 and Fedora:
342
343     # yum install mariadb-server mariadb
344     # systemctl enable mariadb
345     # systemctl start mariadb
346     # mysql_secure_installation
347
348 SUSE:
349
350     # zypper install mysql mysql-client
351     # chkconfig mysqld on
352     # service mysqld start
353
354 FreeBSD:
355
356     # pkg install mysql56-server
357     # sysrc mysql_enable=yes
358     # service mysql-server restart
359     # mysql_secure_installation
360
361 #### <a id="installing-database-mysql-modules"></a> Installing the IDO modules for MySQL
362
363 The next step is to install the `icinga2-ido-mysql` package using your
364 distribution's package manager.
365
366 Debian/Ubuntu:
367
368     # apt-get install icinga2-ido-mysql
369
370 RHEL/CentOS:
371
372     # yum install icinga2-ido-mysql
373
374 SUSE:
375
376     # zypper install icinga2-ido-mysql
377
378 FreeBSD:
379
380 On FreeBSD the IDO modules for MySQL are included with the icinga2 package
381 and located at /usr/local/share/icinga2-ido-mysql/schema/mysql.sql
382
383 > **Note**
384 >
385 > The Debian/Ubuntu packages provide a database configuration wizard by
386 > default. You can skip the automated setup and install/upgrade the
387 > database manually if you prefer that.
388
389 #### <a id="setting-up-mysql-db"></a> Setting up the MySQL database
390
391 Set up a MySQL database for Icinga 2:
392
393     # mysql -u root -p
394
395     mysql>  CREATE DATABASE icinga;
396             GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';
397
398 After creating the database you can import the Icinga 2 IDO schema using the
399 following command:
400
401     # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql
402
403
404 #### <a id="enabling-ido-mysql"></a> Enabling the IDO MySQL module
405
406 The package provides a new configuration file that is installed in
407 `/etc/icinga2/features-available/ido-mysql.conf`. You will need to
408 update the database credentials in this file.
409
410 All available attributes are explained in the
411 [IdoMysqlConnection object](6-object-types.md#objecttype-idomysqlconnection)
412 chapter.
413
414 You can enable the `ido-mysql` feature configuration file using
415 `icinga2 feature enable`:
416
417     # icinga2 feature enable ido-mysql
418     Module 'ido-mysql' was enabled.
419     Make sure to restart Icinga 2 for these changes to take effect.
420
421 After enabling the ido-mysql feature you have to restart Icinga 2:
422
423 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
424
425     # service icinga2 restart
426
427 RHEL/CentOS 7 and Fedora:
428
429     # systemctl restart icinga2
430
431 FreeBSD:
432
433     # service icinga2 restart
434
435 ### <a id="configuring-db-ido-postgresql"></a> Configuring DB IDO PostgreSQL
436
437 #### <a id="installing-database-postgresql-server"></a> Installing PostgreSQL database server
438
439 Debian/Ubuntu:
440
441     # apt-get install postgresql
442
443 RHEL/CentOS 5/6:
444
445     # yum install postgresql-server postgresql
446     # chkconfig postgresql on
447     # service postgresql start
448
449 RHEL/CentOS 7:
450
451     # yum install postgresql-server postgresql
452     # postgresql-setup --initdb
453     # systemctl enable postgresql
454     # systemctl start postgresql
455
456 SUSE:
457
458     # zypper install postgresql postgresql-server
459     # chkconfig postgresql on
460     # service postgresql start
461
462 FreeBSD:
463
464     # pkg install postgresql93-server
465     # sysrc postgresql_enable=yes
466     # service postgresql start
467
468 #### <a id="installing-database-postgresql-modules"></a> Installing the IDO modules for PostgreSQL
469
470 The next step is to install the `icinga2-ido-pgsql` package using your
471 distribution's package manager.
472
473 Debian/Ubuntu:
474
475     # apt-get install icinga2-ido-pgsql
476
477 RHEL/CentOS:
478
479     # yum install icinga2-ido-pgsql
480
481 SUSE:
482
483     # zypper install icinga2-ido-pgsql
484
485 FreeBSD:
486
487 On FreeBSD the IDO modules for PostgreSQL are included with the icinga2 package
488 and located at /usr/local/share/icinga2-ido-pgsql/schema/pgsql.sql
489
490 > **Note**
491 >
492 > Upstream Debian packages provide a database configuration wizard by default.
493 > You can skip the automated setup and install/upgrade the database manually
494 > if you prefer that.
495
496 #### Setting up the PostgreSQL database
497
498 Set up a PostgreSQL database for Icinga 2:
499
500     # cd /tmp
501     # sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD 'icinga'";
502     # sudo -u postgres createdb -O icinga -E UTF8 icinga
503     # sudo -u postgres createlang plpgsql icinga
504
505 > **Note**
506 >
507 > When using PostgreSQL 9.x you can omit the `createlang` command.
508
509 Locate your pg_hba.conf (Debian: `/etc/postgresql/*/main/pg_hba.conf`,
510 RHEL/SUSE: `/var/lib/pgsql/data/pg_hba.conf`), add the icinga user with md5
511 authentication method and restart the postgresql server.
512
513     # vim /var/lib/pgsql/data/pg_hba.conf
514
515     # icinga
516     local   icinga      icinga                            md5
517     host    icinga      icinga      127.0.0.1/32          md5
518     host    icinga      icinga      ::1/128               md5
519
520     # "local" is for Unix domain socket connections only
521     local   all         all                               ident
522     # IPv4 local connections:
523     host    all         all         127.0.0.1/32          ident
524     # IPv6 local connections:
525     host    all         all         ::1/128               ident
526
527     # service postgresql restart
528
529
530 After creating the database and permissions you can import the Icinga 2 IDO
531 schema using the following command:
532
533     # export PGPASSWORD=icinga
534     # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql
535
536
537 #### <a id="enabling-ido-postgresql"></a> Enabling the IDO PostgreSQL module
538
539 The package provides a new configuration file that is installed in
540 `/etc/icinga2/features-available/ido-pgsql.conf`. You will need to update
541 the database credentials in this file.
542
543 All available attributes are explained in the
544 [IdoPgsqlConnection object](6-object-types.md#objecttype-idopgsqlconnection)
545 chapter.
546
547 You can enable the `ido-pgsql` feature configuration file using
548 `icinga2 feature enable`:
549
550     # icinga2 feature enable ido-pgsql
551     Module 'ido-pgsql' was enabled.
552     Make sure to restart Icinga 2 for these changes to take effect.
553
554 After enabling the ido-pgsql feature you have to restart Icinga 2:
555
556 Debian/Ubuntu, RHEL/CentOS 6, SUSE and FreeBSD:
557
558     # service icinga2 restart
559
560 RHEL/CentOS 7 and Fedora:
561
562     # systemctl restart icinga2
563
564
565 ### <a id="icinga2-user-interface-webserver"></a> Webserver
566
567 Debian/Ubuntu:
568
569     # apt-get install apache2
570
571 RHEL/CentOS 6:
572
573     # yum install httpd
574     # chkconfig httpd on
575     # service httpd start
576
577 RHEL/CentOS 7/Fedora:
578
579     # yum install httpd
580     # systemctl enable httpd
581     # systemctl start httpd
582
583 SUSE:
584
585     # zypper install apache2
586     # chkconfig on
587     # service apache2 start
588
589 FreeBSD (nginx, but you could also use the apache24 package):
590
591     # pkg install nginx php56-gettext php56-ldap php56-openssl php56-mysql php56-pdo_mysql php56-pgsql php56-pdo_pgsql php56-sockets php56-gd pecl-imagick pecl-intl
592     # sysrc php_fpm_enable=yes
593     # sysrc nginx_enable=yes
594     # sed -i '' "s/listen\ =\ 127.0.0.1:9000/listen\ =\ \/var\/run\/php5-fpm.sock/" /usr/local/etc/php-fpm.conf
595     # sed -i '' "s/;listen.owner/listen.owner/" /usr/local/etc/php-fpm.conf
596     # sed -i '' "s/;listen.group/listen.group/" /usr/local/etc/php-fpm.conf
597     # sed -i '' "s/;listen.mode/listen.mode/" /usr/local/etc/php-fpm.conf
598     # service php-fpm start
599     # service nginx start
600
601 ### <a id="icinga2-user-interface-firewall-rules"></a> Firewall Rules
602
603 Example:
604
605     # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
606     # service iptables save
607
608 RHEL/CentOS 7 specific:
609
610     # firewall-cmd --add-service=http
611     # firewall-cmd --permanent --add-service=http
612
613 FreeBSD:
614 Please consult the [FreeBSD Handbook](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html) how to configure one of FreeBSD's firewalls.
615
616
617 ### <a id="setting-up-external-command-pipe"></a> Setting Up External Command Pipe
618
619 Web interfaces and other Icinga addons are able to send commands to
620 Icinga 2 through the external command pipe.
621
622 You can enable the External Command Pipe using the CLI:
623
624     # icinga2 feature enable command
625
626 After that you will have to restart Icinga 2:
627
628 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
629
630     # service icinga2 restart
631
632 RHEL/CentOS 7 and Fedora:
633
634     # systemctl restart icinga2
635
636 FreeBSD:
637
638     # service icinga2 restart
639
640 By default the command pipe file is owned by the group `icingacmd` with
641 read/write permissions. Add your webserver's user to the group `icingacmd` to
642 enable sending commands to Icinga 2 through your web interface:
643
644     # usermod -a -G icingacmd www-data
645
646 FreeBSD:
647 On FreeBSD the rw directory is owned by the group `www`. You do not need to add the
648 user `icinga` to the group `www`.
649
650 Debian packages use `nagios` as the default user and group name. Therefore
651 change `icingacmd` to `nagios`.
652
653 The webserver's user is different between distributions so you might have to
654 change `www-data` to `wwwrun`, `www`, or `apache`.
655
656 Change "www-data" to the user you're using to run queries.
657
658 You can verify that the user has been successfully added to the `icingacmd`
659 group using the `id` command:
660
661     $ id <your-webserver-user>
662
663
664 ### <a id="setting-up-icingaweb2"></a> Installing up Icinga Web 2
665
666 Please consult the [installation documentation](https://github.com/Icinga/icingaweb2/blob/master/doc/installation.md)
667 for further instructions on how to install Icinga Web 2.
668
669
670 ## <a id="install-addons"></a> Addons
671
672 A number of additional features are available in the form of addons. A list of
673 popular addons is available in the
674 [Addons and Plugins](14-addons-plugins.md#addons-plugins) chapter.