Sunday, 20 November 2016

Instalasi Tirta ERP dengan NGINX sebagai Web Server

Status : Draft

Untuk panduan instalasi menggunakan Apache Web Server dapat dilihat di [1]

Selain paket-paket software yang perlu diinstall di [1], kita perlu menginstall paket software berikut :

php7.2-fpm
nginx

php-fpm


Buat file /etc/nginx/conf.d/fpm72.conf , yang berisi : 

upstream fpm {
        server unix:/run/php/php7.2-fpm.sock;
}

sudo /etc/init.d/php7.2-fpm restart

NGINX

Konfigurasi NGINX


Untuk konfigurasi virtual host :

/etc/nginx/sites-available/tirtaerp

server {
        server_name tirtaerp.np;
        root /webapps/tirta-erp/web;
        access_log /var/log/nginx/tirtaerp/access.log;
        error_log /var/log/nginx/tirtaerp/error.log;
        fastcgi_read_timeout 300s;
        location / {
                try_files $uri /index.php/$uri?$args;
        }
        location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(.+?\.php)(/.*)$;
                if (!-f $document_root$fastcgi_script_name) {
                        return 404;
                }
                include fastcgi_params;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param   PATH_INFO               $fastcgi_path_info;  
                fastcgi_pass fpm72;
        }
}

Buat symlink ke /etc/nginx/sites-enable/tirtaerp

sudo service nginx restart

Troubleshooting 

Jika anda mendapatkan error seperti berikut :

xvfb-run: error: xauth command not found php-fpm

Lakukan hal berikut :

Edit : /etc/php/7.0/fpm/pool.d/www.conf

Lalu hilangkan komentar dari :


clear_env = no

atau

tambahkan baris berikut :

env[PATH] = '/usr/local/bin:/usr/bin:/bin'

Seperti dijelaskan di [2]

Referensi


  1. Instalasi dan Update, http://tirtaerp.openthinklabs.com/2015/01/instalasi-dan-update.html#more
  2.  WkHTMLtoPDF 0.12.2.1 PHP exec xvfb-run: Error: xauth command not found, https://stackoverflow.com/questions/30542462/wkhtmltopdf-0-12-2-1-php-exec-xvfb-run-error-xauth-command-not-found/30553715#30553715

No comments:

Post a Comment