Ad Widget

Collapse

Apache config file not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SatanicGeek
    Junior Member
    • Feb 2019
    • 3

    #1

    Apache config file not working

    Hello everyone !

    I'm new to Zabbix and the best way to test and discover this beautiful tool is to install a server. And that's what I did !
    Everything went well until I tried to access http://myserver/zabbix

    I'm redirected to /zabbix/setup.php and I have this page showing me errors with my config :



    After seeing this, I tried to check if the zabbix.conf file exists and if it's in the correct folder (/etc/httpd/conf.d/zabbix.conf) and it's all good.
    I changed the timezone and restarted my server.

    Aaaaand it's not working. I have the same message when I try to setup the frontend.

    I tried a lot of things (chmod, chown, new vhost, changing the config, to install from scratch Zabbix Server) and it's not working.
    I tried to search this issue on Google but I cannot find something that can help me.

    So, anyone had this issue ?

    Here's my setup :

    Hyper-V VM
    CentOS 7.4 x64 minimal
    LAMP (PHP7.3), Webmin, SSH
    SELinux=disabled
    Zabbix Server 4.0.4 (that's what I have at the bottom of the page)

    I don't see anything in the log files.

    Can anyone help me ?

    Thank you in advance !
  • SatanicGeek
    Junior Member
    • Feb 2019
    • 3

    #2
    Hello, I found the solution !

    The problem does not come from Apache or Zabbix config.
    It comes from the config file I have inside /etc/httpd/conf,d/zabbix.conf.

    This is the default config provided by Zabbix :
    Code:
    #
    # Zabbix monitoring system php web frontend
    #
    
    Alias /zabbix /usr/share/zabbix
    
    <Directory "/usr/share/zabbix">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    
        <IfModule mod_php5.c>
            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 Europre/Riga
        </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>
    Since I have PHP7.3, I changed the line
    Code:
    <IfModule mod_php5.c>
    to
    Code:
    <IfModule mod_php7.c>
    Then a simple apachectl restart and it's all good !
    Code:
    #
    # Zabbix monitoring system php web frontend
    #
    
    Alias /zabbix /usr/share/zabbix
    
    <Directory "/usr/share/zabbix">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    
        <IfModule mod_php7.c>
            php_value max_execution_time 300
            php_value memory_limit 512M
            php_value post_max_size 128M
            php_value upload_max_filesize 128M
            php_value max_input_time 300
            php_value max_input_vars 10000
            php_value always_populate_raw_post_data -1
            php_value date.timezone Europe/Zurich
        </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>
    I hope this can help some people how struggle to install the WebUI with PHP > 5

    Comment

    Working...