Installing Zabbix on server with ISPConfig

Discussion in 'General' started by gawry, Aug 10, 2011.

  1. gawry

    gawry New Member

    Hi folks...

    I'm trying to monitor my servers with zabbix but i'm having problems installing it.

    I did the usual
    Code:
    apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
    and then I've added a website in ISPConfig.

    monitor.domain.com
    With SuExec and FCGI

    I've added the following to the apache directives

    Code:
    # Define /zabbix alias, this is the default
    <IfModule mod_alias.c>
        Alias /zabbix /usr/share/zabbix
    </IfModule>
    
    #SSLEngine on
    #SSLCertificateKeyFile /etc/apache2/ssl/ispserver.key
    #SSLCertificateFile /etc/apache2/ssl/STAR_hostpress_me.crt
    #SSLCertificateChainFile /etc/apache2/ssl/hostpress_me.ca-bundle
    
        <Directory "/usr/share/zabbix">
    AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-#fcgi-starter .php
            Options +ExecCGI
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
    but as i'm not an experienced Apache admin i'm not really sure if this is the right way to do it.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Looks ok, but can you post the full Apache vhost configuration of that web site so that I can take a look?
     
  3. gawry

    gawry New Member

    Here is the vhost file

    Code:
    <Directory /var/www/monitor.domain.me>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost *:80>
          DocumentRoot /var/www/monitor.domain.me/web
      
        ServerName monitor.domain.me
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/monitor.domain.me/error.log
    
    
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 503 /error/503.html
    	
        <Directory /var/www/monitor.domain.me/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
        <Directory /var/www/clients/client1/web5/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
    
        # suexec enabled
        SuexecUserGroup web5 client1
        # Clear PHP settings of this website
        <FilesMatch "\.ph(p3?|tml)$">
            SetHandler None
        </FilesMatch>
        # php as fast-cgi enabled
        <IfModule mod_fcgid.c>
          
    	  # SocketPath /tmp/fcgid_sock/
    	  
    	  # IdleTimeout n (3600 seconds)
    	  # An idle fastcgi application will be terminated after IdleTimeout seconds.
          IdleTimeout 3600
    	  
    	  # ProcessLifeTime n (7200 seconds)
          # A fastcgi application will be terminated if lifetime expired, even no error is detected.
          ProcessLifeTime 7200
    	  
    	  # MaxProcessCount n (1000)
          # The max count of total fastcgi process count.
          # MaxProcessCount 1000
          
    	  # DefaultMinClassProcessCount n (3)
          # The minimum number of fastcgi application instances for any one fastcgi application.
          # Idle fastcgi will not be killed if their count is less than n
          # Set this to 0, and tweak IdleTimeout
    	  DefaultMinClassProcessCount 0
    	  
    	  # DefaultMaxClassProcessCount n (100)
          # The maximum number of fastcgi application instances allowed to run for
          # particular one fastcgi application.
          DefaultMaxClassProcessCount 100
    	  
    	  # IPCConnectTimeout n (3 seconds)
          # The connect timeout to a fastcgi application.
          IPCConnectTimeout 8
    	  
    	  # IPCCommTimeout n (20 seconds)
          # The communication timeout to a fastcgi application. Please increase this
          # value if your CGI have a slow initialization or slow respond.
          IPCCommTimeout 360
          
    	  # BusyTimeout n (300 seconds)
          # A fastcgi application will be terminated if handing a single request
          # longer than busy timeout.
    	  BusyTimeout 300
    	  
        </IfModule>
        <Directory /var/www/monitor.domain.me/web>
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    	<Directory /var/www/clients/client1/web5/web>
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
          AssignUserId web5 client1
        </IfModule>
    
        <IfModule mod_dav_fs.c>
          # DO NOT REMOVE THE COMMENTS!
          # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
          # WEBDAV END
        </IfModule>
    
    # Define /zabbix alias, this is the default
    <IfModule mod_alias.c>
        Alias /zabbix /usr/share/zabbix
    </IfModule>
    
    #SSLEngine on
    #SSLCertificateKeyFile /etc/apache2/ssl/ispserver.key
    #SSLCertificateFile /etc/apache2/ssl/STAR_domain_me.crt
    #SSLCertificateChainFile /etc/apache2/ssl/domain_me.ca-bundle
    
        <Directory "/usr/share/zabbix">
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-#fcgi-starter .php
            Options +ExecCGI
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Plese remove the # in the line:

    FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-#fcgi-starter .php

    so that it reads:

    FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
     
  5. gawry

    gawry New Member

    Great! I believe we are close. I can see the Login page.

    But there are a couple errors

    Code:
    
        file_exists(): open_basedir restriction in effect. File(/usr/share/zabbix/conf/zabbix.conf.php) is not within the allowed path(s): (/var/www/clients/client1/web5/web:/var/www/clients/client1/web5/tmp:/var/www/monitor.domain.me/web:/srv/www/monitor.domain.me/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/usr/share/zabbix)[/usr/share/zabbix/include/config.inc.php:129]
        file_exists(): open_basedir restriction in effect. File(/usr/share/zabbix/conf/zabbix.conf.php) is not within the allowed path(s): (/var/www/clients/client1/web5/web:/var/www/clients/client1/web5/tmp:/var/www/monitor.domain.me/web:/srv/www/monitor.domain.me/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/usr/share/zabbix)[/usr/share/zabbix/include/config.inc.php:164]
        include_once(setup.php): failed to open stream: No such file or directory[/usr/share/zabbix/include/config.inc.php:225]
        include_once(): Failed opening 'setup.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')[/usr/share/zabbix/include/config.inc.php:225]
        Unable to select configuration
        Timezone for PHP is not set. Please set "date.timezone" option in php.ini.
    
    
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Add the path to zabbix "/usr/share/zabbix" to the open_basedir path setting on the options tab.
     
  7. gawry

    gawry New Member

    I've added but it didn't work. So I added the exactly the path he gave me.

    Code:
    /usr/share/zabbix:/usr/share/zabbix/conf/zabbix.conf.php
    But know i have different errors. It doesnt show the login page but a Warning with the following errors

    Code:
        include(/etc/zabbix/dbconfig.php): failed to open stream: Permission denied[/usr/share/zabbix/include/config.inc.php:131]
        include(): Failed opening '/usr/share/zabbix/conf/zabbix.conf.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')[/usr/share/zabbix/include/config.inc.php:131]
    
    Zabbix is temporarily unavailable!
    
     
  8. gawry

    gawry New Member

    It seems to be working now.


    I've just changed permissions of the dbconfig.php file to -rw-r--r-- and it worked

    -rw-r--r-- 1 www-data www-data 482 Aug 11 12:10 /etc/zabbix/dbconfig.php
     

Share This Page