H
H
HeroFromEarth2016-07-24 21:12:31
Apache HTTP Server
HeroFromEarth, 2016-07-24 21:12:31

Zabbix and site on the same server?

I ran into a problem:
I raised my site on Apache (httpd) on a server running CentOS 7. Now I’m trying to raise Zabbix on it, I configured everything and everything is in order in the Zabbix logs, but when installing via the web I saw the message: "Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time")". I started poking around and realized that for some reason Zabbix was taking my site's php-config, which is also in /etc/httpd/conf.d. I remove this config from the directory and restart httpd - there are no errors, the settings are taken from the required file. I return - takes again the settings from the config for the site. What is the reason and how to fix it?
Here is the config for the site (/etc/httpd/conf.d/site1.conf):

<VirtualHost *:80>
 ServerName site1.ru
 ServerAlias www.site1.ru
 DocumentRoot /web/site1.ru/www
 <Directory /web/site1.ru/www>
 Options FollowSymLinks
 AllowOverride none
 Require all granted
 </Directory>
 ErrorLog /web/site1.ru/logs/error.log
 CustomLog /web/site1.ru/logs/access.log common
php_admin_value date.timezone 'Europe/Moscow'
php_admin_value max_execution_time 60
php_admin_value upload_max_filesize 30M
</VirtualHost>

And config for Zabbix (/etc/httpd/conf.d/zabbix.conf):
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Require all granted
    <IfModule mod_php5.c>
        php_value memory_limit 256M
        php_value post_max_size 16M
        php_value upload_max_filesize 30M
        php_value max_execution_time 300
        php_value max_input_time 300
        php_value always_populate_raw_post_data -1
        php_value date.timezone Europe/Moscow
    </IfModule>
</Directory>
<Directory "/usr/share/zabbix/conf">
    Require all denied
</Directory>
<Directory "/usr/share/zabbix/app">
    Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">
    Require all denied
</Directory>
<Directory "/usr/share/zabbix/local">
    Require all denied
</Directory>

The line in /etc/httpd/conf/httpd.conf is uncommented IncludeOptional conf.d/*.conf, if that matters.
Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
landergate, 2016-07-24
@HeroFromEarth

Installing the zabbix-web package puts the zabbix.conf file in /etc/httpd/conf.d. This file is loaded when the httpd service is started, and overrides some Apache options for scripts run from /usr/share/zabbix/ (web interface), as recommended by Zabbix:

php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga

These settings do not apply to your site. Zabbix does not take anything.
Make sure that your own config, which you suspect is somehow preventing Zabbix from working, is not declared in a way that interferes with Zabbix when accessing the web server. You can show it in the text of the question so that you can guess what exactly in it can lead to such behavior.
Try php_admin_valuemoving it from site1.conf to a block <Directory /web/site1.ru/www>, similar to the second config.
Thus, overwrite of these parameters will only occur within scripts in /web/site1.ru/www

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question