20-Advanced-Topics.md (icingaweb2-2.11.3) | : | 20-Advanced-Topics.md (icingaweb2-2.11.4) | ||
---|---|---|---|---|
skipping to change at line 182 | skipping to change at line 182 | |||
Create the database and add a new user as shown below for MySQL/MariaDB: | Create the database and add a new user as shown below for MySQL/MariaDB: | |||
``` | ``` | |||
sudo mysql -p | sudo mysql -p | |||
CREATE DATABASE icingaweb2; | CREATE DATABASE icingaweb2; | |||
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icing aweb2.* TO 'icingaweb2'@'localhost' IDENTIFIED BY 'icingaweb2'; | GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icing aweb2.* TO 'icingaweb2'@'localhost' IDENTIFIED BY 'icingaweb2'; | |||
quit | quit | |||
mysql -p icingaweb2 < /usr/share/doc/icingaweb2/schema/mysql.schema.sql | mysql -p icingaweb2 < /usr/share/icingaweb2/schema/mysql.schema.sql | |||
``` | ``` | |||
Then generate a new password hash as described in the [authentication docs](05-A uthentication.md#authentication-configuration-db-setup) | Then generate a new password hash as described in the [authentication docs](05-A uthentication.md#authentication-configuration-db-setup) | |||
and use it to insert a new user called `icingaadmin` into the database. | and use it to insert a new user called `icingaadmin` into the database. | |||
``` | ``` | |||
mysql -p icingaweb2 | mysql -p icingaweb2 | |||
INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('icingaadmin', 1, '$1$EzxLOFDr$giVx3bGhVm4lDUAw6srGX1'); | INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('icingaadmin', 1, '$1$EzxLOFDr$giVx3bGhVm4lDUAw6srGX1'); | |||
quit | quit | |||
skipping to change at line 311 | skipping to change at line 311 | |||
* [Chef cookbook](https://icinga.com/products/integrations/chef/) | * [Chef cookbook](https://icinga.com/products/integrations/chef/) | |||
If you are automating the installation of Icinga Web 2, you may want to skip the wizard and do things yourself. | If you are automating the installation of Icinga Web 2, you may want to skip the wizard and do things yourself. | |||
These are the steps you'd need to take assuming you are using MySQL/MariaDB. If you are using PostgreSQL please adapt | These are the steps you'd need to take assuming you are using MySQL/MariaDB. If you are using PostgreSQL please adapt | |||
accordingly. Note you need to have successfully completed the Icinga 2 installat ion, installed the Icinga Web 2 packages | accordingly. Note you need to have successfully completed the Icinga 2 installat ion, installed the Icinga Web 2 packages | |||
and all the other steps described above first. | and all the other steps described above first. | |||
1. Install PHP dependencies: `php`, `php-intl`, `php-imagick`, `php-gd`, `php-my sql`, `php-curl`, `php-mbstring` used | 1. Install PHP dependencies: `php`, `php-intl`, `php-imagick`, `php-gd`, `php-my sql`, `php-curl`, `php-mbstring` used | |||
by Icinga Web 2. | by Icinga Web 2. | |||
2. Create a database for Icinga Web 2, i.e. `icingaweb2`. | 2. Create a database for Icinga Web 2, i.e. `icingaweb2`. | |||
3. Import the database schema: `mysql -D icingaweb2 < /usr/share/icingaweb2/etc/ schema/mysql.schema.sql`. | 3. Import the database schema: `mysql -D icingaweb2 < /usr/share/icingaweb2/sche ma/mysql.schema.sql`. | |||
4. Insert administrator user in the `icingaweb2` database: | 4. Insert administrator user in the `icingaweb2` database: | |||
`INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('admin', 1, '< hash>')`, where `<hash>` is the output | `INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('admin', 1, '< hash>')`, where `<hash>` is the output | |||
of `php -r 'echo password_hash("yourtopsecretpassword", PASSWORD_DEFAULT);'`. | of `php -r 'echo password_hash("yourtopsecretpassword", PASSWORD_DEFAULT);'`. | |||
5. Make sure the `ido-mysql` and `api` features are enabled in Icinga 2: `icinga 2 feature enable ido-mysql` and | 5. Make sure the `ido-mysql` and `api` features are enabled in Icinga 2: `icinga 2 feature enable ido-mysql` and | |||
`icinga2 feature enable api`. | `icinga2 feature enable api`. | |||
6. Generate Apache/nginx config. This command will print an apache config for yo u on stdout: | 6. Generate Apache/nginx config. This command will print an apache config for yo u on stdout: | |||
`icingacli setup config webserver apache`. Similarly for nginx. You need to plac e that configuration in the right place, | `icingacli setup config webserver apache`. Similarly for nginx. You need to plac e that configuration in the right place, | |||
for example `/etc/apache2/sites-enabled/icingaweb2.conf`. | for example `/etc/apache2/sites-enabled/icingaweb2.conf`. | |||
7. Add `www-data` user to `icingaweb2` group if not done already (`usermod -a -G icingaweb2 www-data`). | 7. Add `www-data` user to `icingaweb2` group if not done already (`usermod -a -G icingaweb2 www-data`). | |||
8. Create the Icinga Web 2 configuration in `/etc/icingaweb2`. The directory can be easily created with: | 8. Create the Icinga Web 2 configuration in `/etc/icingaweb2`. The directory can be easily created with: | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |