1. apt-get install mysql-server
2. mysql
a. Setup rights for user root or zabbix or similar
b. create DB zabbix with collate utf8_bin
c. create user zabbix with correct rights on zabbix DB
3. apt-get install zabbix-server-mysql zabbix-frontend-php php-mysql
4. nano /etc/mysql/mysql.conf.d/mysqld.cnf
a. setup bind setting to allow or not remote connections to DB
5. /etc/init.d/mysql restart
6. a2enconf zabbix-frontend-php
7. nano /etc/php/7.2/apache2/php.ini
a. setup date.timezone in php.ini (Europe/Rome)
8. systemctl reload apache2
9. cd /usr/share/zabbix-server-mysql/
10. gunzip data.sql.gz
11. gunzip images.sql.gz
12. gunzip schema.sql.gz
13. mysql -uzabbix -p zabbix < schema.sql
14. mysql -uzabbix -p zabbix < images.sql
15. mysql -uzabbix -p zabbix < data.sql
16. open browser to http://
17. mv zabbix.conf.php /etc/zabbix/
19. chown root:root zabbix.conf.php
20. apt-get install zabbix-agent
21. nano /etc/zabbix/zabbix_server.conf
a. verify DBPassword correctly reported into zabbix_server.conf file
22. systemctl enable zabbix-server
Articoli con tag apache
How to install Zabbix on Debian 9
Apache2 MPM ITK on debian 9
This is a secure solution for having a web server for many sites. With this you can specify which server user will be used for which site so apache will execute the code (mainly php) with that user preventing file system access to bad code.
On a fresh Debian 9 installation (with just SSH Server installed) let’s do:
apt-get install libapache2-mpm-itk libapache2-mod-php7.0
We’ll now enable that modules that could be useful and the one necessary:
a2enmod mpm_itk a2enmod rewrite
Now let’s configure a virtualhost:
cd /etc/apache2/sites-available touch my_website.conf nano my_website.conf
and put this inside the file (obviously you can change settings as you need):
<VirtualHost *:80> ServerName my_website ServerAdmin paolo@my_website DocumentRoot /home/www/my_website/home/ <IfModule mpm_itk_module> AssignUserId my_username my_usergroup </IfModule> <Directory /home/www/my_website/home/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>
Let’s activate my_website:
a2ensite my_website
At this point we need to create the user and the group we indicate into the file:
useradd -d /home/www/my_website -s /usr/sbin/nologin my_username
and the folders onto the path:
mkdir /home/www mkdir /home/www/my_website mkdir /home/www/my_website/home cd /home/www/my_website chown -R my_username:my_username home/
At this point we have a virtualhost that points to a folder path where apache will run scripts as my_username user.
Therefore it’s possibile to configure mysql o any other service to make this webserver richer of functions.
Recent Comments