Want more timely Centmin Mod News Updates?
Become a Member

How to install freescout on centminmod?

Discussion in 'Other Web Apps usage' started by hnit, Jan 22, 2019.

  1. hnit

    hnit New Member

    24
    4
    3
    Apr 12, 2017
    Ratings:
    +4
    Local Time:
    3:01 AM
    Hi team,
    I am in a bit of pinch here while I was trying to install freescout on my centminmod powered server.

    Whatever I did result in a 502 or a 404 and I couldn't figure out what to do with it.


    Here's the URL for the git repo and the installation instructions provided by them.

    freescout-helpdesk/freescout

    Hoping someone can help me here.
    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,519
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    7:31 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    there nginx config is at freescout-helpdesk/freescout

    seems like only setting from their config needed for Centmin Mod Nginx vhost is the change in main web root / location context
    Code (Text):
       location / {
           try_files $uri $uri/ /index.php?$query_string;
       }
    

    php location context and static file expire directives are already taken care of by /usr/local/nginx/conf/php.conf and /usr/local/nginx/conf/staticfiles.conf include files in default nginx vhosts

    BUT DO NOT set cgi.fix_pathinfo=0, that isn't required. For overview of Centmin Mod directory and vhost structure read Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS

    edit: actually there's a slight change for /usr/local/nginx/conf/php.conf maybe if you still have issues. But as /usr/local/nginx/conf/php.conf is globally shared with all nginx vhosts by default, you don't want to edit that one. Make a copy for freescout named /usr/local/nginx/conf/php-freescout.conf
    Code (Text):
    cp -a /usr/local/nginx/conf/php.conf /usr/local/nginx/conf/php-freescout.conf
    

    edit /usr/local/nginx/conf/php-freescout.conf and change
    Code (Text):
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    

    to freescout version
    Code (Text):
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    

    then edit your site's nginx vhost to change reference of /usr/local/nginx/conf/php.conf to /usr/local/nginx/conf/php-freescout.conf
    Code (Text):
    #include /usr/local/nginx/conf/php.conf;
    include /usr/local/nginx/conf/php-freescout.conf;
    

    restart nginx and php-fpm
    Code (Text):
    nprestart
    
     
    Last edited: Jan 22, 2019
  3. eva2000

    eva2000 Administrator Staff Member

    54,519
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    7:31 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    looks like location of files matters too from freescout-helpdesk/freescout

    For Centmin Mod Nginx that would mean for example domain freecout.domain.com web root directory is at /home/nginx/domains/freescout.domain.com/public so freescrount needs to be installed at /home/nginx/domains/freescout.domain.com/ and user = nginx instead of www-data

    Also seems Freescout needs PHP fileinfo extension so if you have >1GB memory, set in centmin mod persistent config file /etc/centminmod/custom_config.inc the variable
    Code (Text):
    PHPFINFO='y'
    

    then recompile PHP version via centmin.sh menu option 5 to get PHP fileinfo extension support.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,519
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    7:31 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Did test install for Freescout on Centmin Mod 123.09beta01 Nginx 1.15.8 with PHP 7.2.14 looks good. Looks like location of files matters too from freescout-helpdesk/freescout
    For Centmin Mod Nginx that would mean for example domain freecout.domain.com web root directory is at /home/nginx/domains/freescout.domain.com/public so freescout needs to be installed at /home/nginx/domains/freescout.domain.com/ and user = nginx instead of www-data

    Freescout installed at /home/nginx/domains/freescout.domain.com/ with web root at /home/nginx/domains/freescout.domain.com/public
    Code (Text):
    ls -lah /home/nginx/domains/freescout.domain.com/
    total 596K
    drwxrws--- 19 nginx nginx 4.0K Jan 22 11:19 .
    drwxr-s---  4 nginx nginx 4.0K Jan 22 10:39 ..
    drwxr-sr-x 16 nginx nginx 4.0K Jan 22 10:44 app
    -rw-r--r--  1 nginx nginx 1.8K Jan 22 10:44 artisan
    drwxr-s---  2 nginx nginx 4.0K Jan 22 10:39 backup
    drwxr-sr-x  3 nginx nginx 4.0K Jan 22 10:44 bootstrap
    -rw-r--r--  1 nginx nginx 4.3K Jan 22 10:44 composer.json
    -rw-r--r--  1 nginx nginx 206K Jan 22 10:44 composer.lock
    drwxr-sr-x  2 nginx nginx 4.0K Jan 22 10:44 config
    drwxr-sr-x  5 nginx nginx 4.0K Jan 22 10:44 database
    -rw-r--r--  1 nginx nginx  949 Jan 22 11:37 .env
    -rw-r--r--  1 root  nginx 1.2K Jan 22 11:18 .env.example
    drwxr-sr-x 16 nginx nginx 4.0K Jan 22 10:44 freescout
    -rw-r--r--  1 nginx nginx  34K Jan 22 10:44 LICENSE
    drwxr-s---  2 nginx nginx 4.0K Jan 22 10:39 log
    drwxr-sr-x  2 nginx nginx 4.0K Jan 22 10:44 Modules
    drwxr-sr-x  9 nginx nginx 4.0K Jan 22 10:44 overrides
    -rw-r--r--  1 nginx nginx 1.1K Jan 22 10:44 package.json
    -rw-r--r--  1 nginx nginx 1.1K Jan 22 10:44 phpunit.xml
    drwxr-s---  2 nginx nginx 4.0K Jan 22 10:39 private
    drwxr-sr-x  8 nginx nginx 4.0K Jan 22 11:37 public
    -rw-r--r--  1 nginx nginx 4.0K Jan 22 10:44 README.md
    drwxr-sr-x  5 nginx nginx 4.0K Jan 22 10:44 resources
    drwxr-sr-x  2 nginx nginx 4.0K Jan 22 10:44 routes
    -rw-r--r--  1 nginx nginx  542 Jan 22 10:44 server.php
    drwxrwsr-x  6 nginx nginx 4.0K Jan 22 11:37 storage
    drwxr-sr-x  3 nginx nginx 4.0K Jan 22 10:44 tests
    drwxr-sr-x  2 nginx nginx 4.0K Jan 22 10:44 tools
    drwxr-sr-x 46 nginx nginx 4.0K Jan 22 10:44 vendor
    -rw-r--r--  1 nginx nginx  549 Jan 22 10:44 webpack.mix.js
    -rw-r--r--  1 nginx nginx 236K Jan 22 10:44 yarn.lock
    


    Nginx 1.15.8
    PHP 7.2.14
    Code (Text):
    php -v
    PHP 7.2.14 (cli) (built: Jan 22 2019 11:31:52) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.14, Copyright (c) 1999-2018, by Zend Technologies


    cronjob setup and run as nginx user so use crontab -u nginx -e
    Code (Text):
    crontab -u nginx -e 

    ensure there's a new line break at end and exit nano editor to save
    Code (Text):
    * * * * * /usr/local/bin/php /home/nginx/domains/freescout.domain.com/artisan schedule:run >> /dev/null 2>&1
    
    

    example manual run
    Code (Text):
    /usr/local/bin/php /home/nginx/domains/freescout.domain.com/artisan schedule:run
    Running scheduled command: '/usr/local/bin/php' 'artisan' freescout:fetch-monitor > '/dev/null' 2>&1
    Running scheduled command: '/usr/local/bin/php' 'artisan' freescout:fetch-emails > '/home/nginx/domains/freescout.domain.com/storage/logs/fetch-emails.log' 2>&1
    


    Centmin Mod Nginx vhost only change really required was for web root / location context
    Code (Text):
      location / {
          try_files $uri $uri/ /index.php?$query_string;
       }
    

    and enabling PHP fileinfo PHP extension via centmin mod persistent config file /etc/centminmod/custom_config.inc the variable = PHPFINFO='y' and recompile PHP via centmin.sh menu option 5.

    Installed on dummy domain https://freescout.domain.com/ so ran https://freescout.domain.com/install/. Before run /install directory, be sure to have copied .env.example from /home/nginx/domains/freescout.domain.com/freescout directory to /home/nginx/domains/freescout.domain.com
    Code (Text):
    cd /home/nginx/domains/freescout.domain.com
    cp -apf freescout/.env.example .
    chown nginx:nginx .env.example
    


    centminmod-nginx-freescout-01.png

    first check PHP fileinfo extension missing

    centminmod-nginx-freescout-02.png
    enable PHP fileinfo extension via PHPFINFO='y' and PHP recompile

    centminmod-nginx-freescout-02a.png

    permissions check following instructions at freescout-helpdesk/freescout where Freescout installed at /home/nginx/domains/freescout.domain.com
    Code (Text):
    cd /home/nginx/domains/freescout.domain.com
    chgrp -R nginx storage bootstrap/cache public/css/builds public/js/builds
    chmod -R ugo+rwx storage bootstrap/cache public/css/builds public/js/builds
    


    centminmod-nginx-freescout-03.png

    installed HTTP/2 HTTPS version when setup freescout.domain.com via centmin.sh menu option 2 or nv command

    centminmod-nginx-freescout-04.png
    created mysql database and user via instructions at freescout-helpdesk/freescout or you could be addons/mysqladmin_shell.sh . I used instructions on their site as they used utf8mb4 character set and collations instead of Centmin Mod utf8 defaults.

    centminmod-nginx-freescout-05.png centminmod-nginx-freescout-06.png centminmod-nginx-freescout-07.png
    Freescout web install on Centmin Mod Nginx LEMP stack completed.

    centminmod-nginx-freescout-08.png centminmod-nginx-freescout-09.png centminmod-nginx-freescout-010.png

    Database tables
    Code (Text):
    +-------------------------------+----------------+----------------+-----------+------------+--------+------------+--------------------+
    | Table Name                    | Number of Rows | Storage Engine | Data Size | Index Size | Total  | ROW_FORMAT | TABLE_COLLATION    |
    +-------------------------------+----------------+----------------+-----------+------------+--------+------------+--------------------+
    | freescout.conversations       | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.migrations          | 25 Rows        | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.password_resets     | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.notifications       | 0 Rows         | InnoDB         | 0.02MB    | 0.02MB     | 0.03MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.conversation_folder | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.options             | 1 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.mailbox_user        | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.failed_jobs         | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.mailboxes           | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.jobs                | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.customers           | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.polycast_events     | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.folders             | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.send_logs           | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.emails              | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.modules             | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.attachments         | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.threads             | 0 Rows         | InnoDB         | 0.02MB    | 0.05MB     | 0.06MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.users               | 1 Rows         | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.ltm_translations    | 0 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.activity_logs       | 1 Rows         | InnoDB         | 0.02MB    | 0.00MB     | 0.02MB | Dynamic    | utf8mb4_unicode_ci |
    | freescout.subscriptions       | 12 Rows        | InnoDB         | 0.02MB    | 0.03MB     | 0.05MB | Dynamic    | utf8mb4_unicode_ci |
    +-------------------------------+----------------+----------------+-----------+------------+--------+------------+--------------------+
    


    Login via https://freescout.domain.com

    centminmod-nginx-freescout-011.png centminmod-nginx-freescout-012.png centminmod-nginx-freescout-013.png centminmod-nginx-freescout-014.png centminmod-nginx-freescout-015.png

    Centmin Mod Nginx HTTP/2 HTTPS vhost file at /usr/local/nginx/conf/conf.d/freescout.domain.com.ssl.conf for domain freescout.domain.com - i used self-signed SSL certificate for this so SSL settings and references will differ to when using letsencrypt ssl certs.
    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    # server {
    #       listen   80;
    #       server_name freescout.domain.com www.freescout.domain.com;
    #       return 302 https://$server_name$request_uri;
    # }
    
    server {
      listen 443 ssl http2 reuseport;
      server_name freescout.domain.com www.freescout.domain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/freescout.domain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/freescout.domain.com/freescout.domain.com.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/freescout.domain.com/freescout.domain.com.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
      #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/freescout.domain.com/origin.crt;
      #ssl_verify_client on;
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
     
      # enable ocsp stapling
      #resolver 8.8.8.8 8.8.4.4 valid=10m;
      #resolver_timeout 10s;
      #ssl_stapling on;
      #ssl_stapling_verify on;
      #ssl_trusted_certificate /usr/local/nginx/conf/ssl/freescout.domain.com/freescout.domain.com-trusted.crt;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/freescout.domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/freescout.domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/freescout.domain.com/autoprotect-freescout.domain.com.conf;
      root /home/nginx/domains/freescout.domain.com/public;
      index index.php index.html;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      try_files $uri $uri/ /index.php?$query_string;
    
      }
    
      include /usr/local/nginx/conf/pre-staticfiles-local-freescout.domain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
     
      #include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    

    only changes i made was add default index after root path
    Code (Text):
      root /home/nginx/domains/freescout.domain.com/public;
      index index.php index.html;
    

    And add Freescout rewrite directive for try_files
    Code (Text):
    try_files $uri $uri/ /index.php?$query_string;
    

    to existing location context for web root /
    Code (Text):
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      try_files $uri $uri/ /index.php?$query_string;
    
      }
    

    You can technically remove un-needed stuff in existing location context for web root / to become
    Code (Text):
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      try_files $uri $uri/ /index.php?$query_string;
      }
    
     
    Last edited: Jan 23, 2019
  5. hnit

    hnit New Member

    24
    4
    3
    Apr 12, 2017
    Ratings:
    +4
    Local Time:
    3:01 AM
    Thank you for the detailed tutorial @eva2000, and I'm the same person who opened that GitHub issue.
    I followed each step and ended up with this error.
    My error.log is empty

    [​IMG]