yaobin.wen

Yaobin's Blog

View on GitHub
11 January 2017

Deploy Diagramo on Ubuntu 14.04

by yaobin.wen

Overview

I’m trying to add an in-browser workflow editor for the project I’m working on. After searching online for a while, I decided to give Diagramo a try for several reasons:

In this article, I’ll record down the steps I took to deploy a Diagramo editor locally.

The primary reference I used is this article: How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04. For the sake of simplicity, I’ll refer to this article as [1]. Although this referred article is based upon Ubuntu 16.04, most of the steps are also valid on Ubuntu 14.04 which is the one I used.

Deployment Steps

Step 01: Install Apache2

The installation can be done with the steps below:

Then we need to set the global ServerName to suppress the syntax check warning. Follow the steps below:

Syntax OK

Finally, open a browser window and type 127.0.0.1 in the address text box. We should be able to see the Apache2 Ubuntu Default Page:

Apache2 Ubuntu Default Page

[1] says we need to configure the firewall to allow the Apache traffic. Because we will be using Diagramo in the local environment, the firewall configuration can be skipped for now.

Step 02: Install PHP

According to this AskUbuntu answer, because PHP is not included in Ubuntu’s standard package repositories, we must add it manually:

Then we can run the following command to install PHP and the related sutff:

[1] suggests we modify the order in which Apache searches for the source files. After all of the installation above, the file /etc/apache2/mods-enabled/dir.conf should look like below:

< IfModule mod_dir.c >
     DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
< /IfModule >

The file index.html takes the precedence over the index.php which is the one Diagramo provides. Sure, we can put index.php before index.html, but we can simply delete the index.html file if we are sure we’d like not to use it (and in the case of Diagramo, yes, we are sure we’ll not to use it). For now, we don’t need to do anything. I’ll later describe how to configure the /var/www/html directory to make sure index.php is properly used.

Step 03: Download Diagramo Source Code

You can find Diagramo’s source code on both GitHub and BitBucket. It’s up to you which one you prefer to use.

You can either check out the master branch of the code or download it. For simplicity, we’ll just download the source code.

Suppose the source code is downloaded and unzipped into ~/Downloads/diagramo-master/. You should have the following directory structure at this moment:

[~/Downloads/diagramo-master/]
       |– web (This is the directory we’ll use later.)
       | – COPYRIGHT.txt
       | – LICENSE.txt
       | – README.txt
       | – etc…

Step 04: Move Diagramo to Apache Web Root

Follow the steps below to install Diagramo to Apache’s web root directory which is /var/www/html:

By changing the index.html to index.html.old, we make Apache unable to find index.html so it will use index.php provided by Diagramo instead.

Now open a browser and enter 127.0.0.1 in the address bar. You should be able to see a Welcome to Diagramo installation page:

Welcome to Diagramo installation

Step 05: More PHP Configuration

To install Diagramo successfully, we must do some additional PHP configuration.

In the browser, enter 127.0.0.1/info.php in the address bar, then you should see the details about the Apache service as well as the PHP configuration. You need to pay attention to the following entries:

Now let’s make the configuration changes:

Then we need to give /var/www/html/editor/data/ the write access because Diagramo requires this:

Step 06: Finish Diagramo Installation

At this moment, all the needed configuration is done. We can finish Diagramo installation and start to use it. Follow the steps below:

Diagramo Editor

References

Tags: Tech