Git Product home page Git Product logo

processmaker-guideline's Introduction

Overview

ProcessMaker is an open source, workflow management software suite, which includes tools to automate your workflow, design forms, create documents, assign roles and users, create routing rules, and map an individual process quickly and easily. It's relatively lightweight and doesn't require any kind of installation on the client computer. This file describes the requirements and installation steps for the server.

System Requirements

Install Required System Requirements

Step 1. Install Ubuntu 20.04 LTS

How to install Ubuntu 20.04 LTS

Step 2. Install Required Dependencies (NGINX, PHP and PHP Extensions)

$ sudo apt-get update -y
$ sudo apt install -y \
	php-fpm php-cli php-json php-common php-mysql \
	php-zip php-gd php-mbstring php-curl php-xml \
	php-pear php-bcmath php-imagick php-dom php-sqlite3 \
	nginx vim curl unzip wget supervisor cron build-essential mysql-client

Step 3. Install Composer

$ cd /tmp
$ wget -O composer-setup.php https://getcomposer.org/installer
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
$ composer self-update

Step 4. Install NodeJS

$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs

Click this link if you want to install other NodeJS version.

Step 5. Install Docker

Step 6. Setup MySQL and Redis server

Create a folder:

$ sudo mkdir -p /code/docker
$ cd /code/docker

Inside this folder create 2 file db.env and docker-compose.yml: Create db.env file:

$ cat <<EOF> db.env
MYSQL_ROOT_PASSWORD=pass
MYSQL_PASSWORD=pass
MYSQL_USER=pm
MYSQL_DATABASE=processmaker
EOF

Create docker-compose.yml file:

$ cat << EOF > docker-compose.yml
version: "3.7"
services:
  redis:
    image: redis
    container_name: redis
    ports:
      - 6379:6379
    restart: always
  mysql:
    image: mariadb
    container_name: mysql
    restart: always
    ports:
      - 3306:3306
    env_file:
      - db.env
    volumes:
      - mysql-data:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin
    container_name: phpmyadmin
    ports:
      - 8080:80
    restart: always
    environment:
      PMA_HOST: mysql
volumes:
  mysql-data:
EOF

Run docker-compose:

$ sudo docker-compose up -d

Step 7. Get PM4Core configuration files

$ git clone https://github.com/ProcessMaker/pm4core-docker.git /tmp/pm4core-docker

Step 8. Setting Cron Jobs

$ sudo cp -r /tmp/pm4core-docker/build-files/laravel-cron /etc/cron.d/laravel-cron
$ sudo chmod 0644 /etc/cron.d/laravel-cron && crontab /etc/cron.d/laravel-cron

Step 9. Setup Supervisord

$ sudo bash -c 'cat << "EOF" > /etc/supervisor/conf.d/services.conf
[program:horizon]
directory=/code/pm4
command=php artisan horizon
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true

[program:laravel-echo-server]
directory=/code/pm4
command=npx laravel-echo-server start
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true

[program:cron]
command=cron -f
EOF'

Useful commands:

$ sudo systemctl status supervisor
$ sudo systemctl start supervisor
$ sudo systemctl restart supervisor

If you have any issue with laravel-echo-server, you can use pusher. Create a channel with name processmaker and change value in .env file:

BROADCAST_DRIVER=pusher
...
PUSHER_APP_ID=your_app_id
PUSHER_APP_KEY=your_app_key
PUSHER_APP_SECRET=your_app_secret
PUSHER_CLUSTER=your_app_cluster
PUSHER_TLS=TRUE
PUSHER_DEBUG=FALSE

Step 10. Setup ProcessMaker

  1. Get Processmaker source:
$ sudo mkdir -p /code/pm4
$ git clone https://github.com/jounger/processmaker.git /code/pm4
  1. Copy configuration files:
$ cp -r /tmp/pm4core-docker/build-files/laravel-echo-server.json /code/pm4
$ cp -r /tmp/pm4core-docker/build-files/init.sh /code/pm4
  1. Change database configurations: Export environment variables:
$ export PM_VERSION=4.1.18
$ export PM_APP_URL=http://localhost
$ export PM_APP_PORT=8080
$ export PM_BROADCASTER_PORT=6001
$ export PM_DOCKER_SOCK=/var/run/docker.sock

Change name of containers by local IP address (127.0.0.1):

$ sed -i 's/h mysql/h 127\.0\.0\.1/g' /code/pm4/init.sh
$ sed -i 's/host=mysql/host=127\.0\.0\.1/g' /code/pm4/init.sh
$ sed -i 's/host=redis/host=127\.0\.0\.1/g' /code/pm4/init.sh
$ chmod +x /code/pm4/init.sh

If you are behind proxy, run commands bellow:

$ git checkout /code/pm4/ProcessMaker/Console/Commands/BuildScriptExecutors.php
$ sed -i 's/docker build/docker build \-\-build\-arg http\_proxy\=http\:\/\/0\.0\.0\.0\:0 \-\-build\-arg https\_proxy\=http\:\/\/0\.0\.0\.0\:0/g' /code/pm4/ProcessMaker/Console/Commands/BuildScriptExecutors.php

You need to replace http\:\/\/0\.0\.0\.0\:0 by a real proxy. For example: http\:\/\/10\.10\.10\.10\:8000.

  1. Grant permission to processmaker source
$ sudo chown -R www-data:www-data /code/pm4/storage/
$ sudo chown -R www-data:www-data /code/pm4/bootstrap/cache/
$ sudo chmod -R 0777 /code/pm4/storage/
$ sudo chmod -R o+w /code/pm4/storage/
$ sudo chmod -R 0775 /code/pm4/bootstrap/cache/
  1. Install composer and node dependencies: Composer:
$ cd /code/pm4
$ composer install
$ sudo php artisan key:generate
$ /code/pm4/init.sh

NPM:

$ cd /code/pm4
$ npm install --unsafe-perm=true
$ npm run dev

Step 11. Setup Nginx

Create nginx configuration file for processmaker:

$ sudo bash -c 'cat << "EOF" > /etc/nginx/sites-available/processmaker.conf
server {
    listen 80;
    server_name localhost;
    root /code/pm4/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
EOF'

Then...

$ sudo ln -s /etc/nginx/sites-available/processmaker.conf /etc/nginx/sites-enabled/
$ sudo rm /etc/nginx/sites-enabled/default
$ sudo nginx -t
$ sudo systemctl enable nginx
$ sudo systemctl start nginx
$ sudo systemctl reload nginx
$ sudo systemctl restart nginx

Notice: Debugging

Turn on debug mode in .env to trace detail errors instead of the Whoops page.

APP_DEBUG=TRUE

Enter http://localhost and use default account to login site:

  • username: admin
  • password: admin123

In case you setup Processmaker inside VirtualBox and want to export it outside, firewall must be install and allow what ports you want:

$ sudo apt-get install ufw
$ sudo ufw enable
$ sudo ufw allow ssh // ssh (22) to allow access to inside VM
$ sudo ufw allow 80 // 80 is application port
$ sudo ufw allow 6001 // 6001 is websocket port
$ sudo ufw status verbose

In VirtualBox forward above ports.

End.

processmaker-guideline's People

Contributors

jounger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.