SIGN IN / UP
    opened image

    Filegator is a powerful tool that provides convenient and flexible file and folder management directly from a web browser. If you already have Nginx and PHP-FPM installed on your CentOS 7 server, this detailed guide will be an indispensable aid in the Filegator installation process.

     

    System Upgrade:

    Before starting any work procedure, it is advisable to make sure that system components and packages are updated to the latest versions.

     sudo yum update -y

     

    Step 1: Downloading and unzipping Filegator

    First, we will need to download the current version of Filegator. We recommend downloading the program directly from the official GitHub repository.

     wget https://github.com/filegator/static/raw/master/builds/filegator_latest.zip -P /usr/share/

     

     

    After downloading, unzip:

     unzip -o /usr/share/filegator_latest.zip -d /usr/share/ >/dev/null 

     

     

    Step 2: Set permissions

    Security — first and foremost. Let's make sure the directory with Filegator has the correct owner and permissions.

    
      
     usermod -a -G admin apache && chmod +rx /home/backup && chmod -R 775 /home/admin/web && chown -R apache:apache /usr/share/filegator/private/logs && chown -R apache:apache /usr/share/filegator/repository

     

     

    To provide access to backups created using the VestaCP dashboard:

     chmod +rx /home/backup

     

     

    Step 3: Configure Nginx and PHP-FPM

    The important part of the installation is to configure Nginx to handle requests to Filegator. Depending on your configuration, create or modify the Nginx configuration file to properly handle requests to Filegator by passing them to PHP-FPM for processing.

    In this case, you will need to create or modify the Nginx configuration file to properly handle requests to Filegator by passing them to PHP-FPM for processing.

    In our case, if the VestaCP panel is installed, we also have phpMyadmin and RoundCube installed, so the configuration of this file will take them into account as well.

     

    Create the  filegator-phpmyadmin-roundcube.conf file:

     

    vim /etc/nginx/conf.d/filegator-phpmyadmin-roundcube.conf

     

    And add this code to it:

     server {
        listen $ip_server:80;
        server_name _;
    
        root /usr/share/filegator;
        index index.php;
    
        location / {
            try_files \$uri \$uri/ /index.php?\$args;
        }
    
        location /filegator {
            alias /usr/share/filegator;
    
            location ~ \.php\$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME \$request_filename;
                fastcgi_pass 127.0.0.1:9000;
            }
        }
    
        location /phpmyadmin {
            alias /usr/share/phpMyAdmin;
    
            location ~ \.php\$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME \$request_filename;
                fastcgi_pass 127.0.0.1:9000;
            }
        }
    
        location /phpMyAdmin {
            alias /usr/share/phpMyAdmin;
    
            location ~ \.php\$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME \$request_filename;
                fastcgi_pass 127.0.0.1:9000;
            }
        }
    
        location /roundcubemail {
           index index.php;
           alias /usr/share/roundcubemail;
    
             location ~ \.php\$ {
             include fastcgi_params;
             fastcgi_param SCRIPT_FILENAME \$request_filename;
             fastcgi_pass 127.0.0.1:9000;
        }
    }
        location /webmail {
             index index.php;
             alias /usr/share/roundcubemail;
    
                location ~ \.php\$ {
                    include fastcgi_params;
                    fastcgi_param SCRIPT_FILENAME \$request_filename;
                    fastcgi_pass 127.0.0.1:9000;
        }
    }
    
        include /etc/nginx/conf.d/filegator.inc*;
    }
    

     

     

    Step 4: Modify the Filegator configuration

    By default, Filegator uses specific paths to store files. If necessary, you can change this path:

     sed -i "s#__DIR__\.'/repository'#'/home'#g" /usr/share/

     

     

    Шаг 5: Применение изменений

    Завершающим этапом является перезапуск Nginx и PHP-FPM для того, чтобы все изменения вступили в силу:

     

    systemctl restart nginx 
    systemctl restart php-fpm

     

    Завершение:

    Поздравляем! Теперь у вас есть работающий Filegator на сервере CentOS 7 с Nginx и PHP-FPM. Откройте ваш браузер и перейдите по адресу http://your_domain_or_ip/filegator, чтобы начать работу с вашим новым файловым менеджером.