Step 6 – writing the configuration file
It is quite likely that in the next screen, you will be greeted with failure:
The installation wizard attempted to save the configuration file, but with the access rights that it has, it should not be possible. Previous versions of Zabbix explained two alternatives for proceeding. Unfortunately, Zabbix 4.0 has lost the explanation for one of those. The two possible solutions are as follows:
- Click on Download the configuration file and manually place this file in the htdocs/zabbix/conf directory.
- Make the htdocs/zabbix/conf directory writable by the web server user (execute as root). Use these commands:
# chown <username> /path/to/htdocs/zabbix/conf # chmod 700 /path/to/htdocs/zabbix/conf
Obviously, we need to insert the correct username and directory in these commands. Remember, common locations are /var/www/html and /usr/local/apache2/htdocs—use the one you copied the Zabbix frontend code to. Common users are wwwrun, www-data, nobody, and daemon—you can find out which one the correct user is for your system by running this:
$ ps aux | grep http
You could also run this:
$ ps aux | grep apache
The username that most httpd processes are running under will be the correct one. Once the permissions have been changed, click on Finish. That should successfully save the configuration file.
It is suggested that you restrict the permissions on this file afterwards to be readable only by the web server user, by issuing these commands as root:
# chmod 440 /path/to/htdocs/zabbix/conf/zabbix.conf.php # chown root /path/to/htdocs/zabbix/conf/
The file contains the database password, which is best kept secret.