Author Archives: Moritz Eberhard

Eclipse EMF and GMF Tutorial

This is a small tutorial introducing EMF and GMF plugins of Eclipse. EMF is the abbreviation of “Eclipse Modelling Framework”. Using EMF, models may be created and the java code for them is automatically created. Furthermore, EMF gives the possibility to generate code for an editor using the created model. This editor may be launched as an Eclipse application, which uses the defined model and gives the user the possibility to create model instances. GMF extends this functionality: Notation symbols may be matched to model types and associations. Based on the definition of notation symbols and the matching, java code for a graphic editor can be generated. Launching it as an eclipse application, the model instances can now be created as a diagram.

In this tutorial I will give a brief introduction, how to use EMF and GMF. The model will be a very basic business process model, which consists only of events and process steps. The goal will be to have a graphical editor, which may be used to create a business process using events and process steps. Basically this editor will be created without writing a single line of code.

Further reading: Here are the sources, which I used for creating the example. Further information about EMF, GMF and also Ecore can be found on the following pages:

Getting started

First of all we need to use the Eclipse IDE. In the following example I am using the Juno distribution, but other distributions should do fine as well. Install the following plugins:

  • EMF – Eclipse Modeling Framework SDK
  • Graphical Modeling Framework (GMF) Runtime
  • Graphical Modeling Framework (GMF) Tooling
  • Graphical Modeling Framework (GMF) Tooling – Runtime Extensions

Creating the project using EMF and GMF

Creating a new project, choose “Other” and select “Empty EMF Project” in the “Eclipse Modeling Framework” folder.

Add an empty EMF project

Add an empty EMF project

Choose a project name and click "Finish".

Choose a project name and click “Finish”.

Next step is to create an EMF Ecore model. The project, which we just created, contains a folder named “model”. Right-click this folder, and click “New” -> “Other”. Select “Ecore diagram” in the “Ecore Tools” folder.

Add Ecore diagram

Add Ecore diagram

Choose a name, in this case "businessprocess.ecore."

Choose a name, in this case “businessprocess.ecore.”

The model folder should now contain two files: “businessprocess.ecore” and “businessprocess.ecorediag”. On opening the ecorediag file an editor will show, which lets us create the model in a graphical environment.

Let’s create a basic EMF Ecore model, containing the class ProcessShape, which could either be a ProcessStep or an Event. ProcessShapes are connected using a Sequence. In order to create this model, we just need the types “EClass” and the connection “EReference” and “Inheritance”.

Create the EMF Ecore model for the business processes.

After saving, the model will be also updated in the .ecore file, wich should now look like this:

The update .ecore model.

The update EMF .ecore model.

Right-click the model folder of the project, select “New” -> “Other” and choose “EMF Generator Model” in “Eclipse Modeling Framework”:

Add the EMF Generator model.

Add the EMF Generator model.

In the next step, be sure, that the model folder is selected and give a name for the EMF generator model, i.e. “businessprocess.genmodel”.

Select folder and name for the generator model.

Select folder and name for the EMF generator model.

During the next step, we need to choose the model importer, select “Ecore model”.

Select the model importer for the generator model.

Select the model importer for the generator model.

After, we need to select the EMF .ecore model which we created. Click “Browse Workspace” and select “businessprocess.ecore” in the project we created:

Select the ecore model for the generator model creation.

Select the ecore model for the generator model creation.

Now you just need to hit “Load”, go to the next step and click “Finish”. The file “businessprocess.genmodel” should now be created and reside in the “model” folder of the project. The .genmodel file will look similar to the .ecore file:

The genmodel file of the project.

The genmodel file of the project.

We need to set the base package,select the first entity “Businessprocess” and open the Properties view. If it is not opened already, open it using right-click on “Businessprocess” and clicking “Show Properties View”. The basepackage needs to be set to the project name and the folder, in which the model resides. In my case, the name of the project is “com.meberhard.me” and the folder “model”, so the name of the base package is “com.meberhard.me.model”.

Properties view of the genmodel.

Properties view of the genmodel.

Now everything is set to generate the model and the edit code. Right click on top element “Businessprocess” in the .genmodel file and click “Generate Model Code”, do the same again and click “Generate Edit Code”.

Generate the model and the edit code.

Generate the model and the edit code.

If this step went well, you should now one new project in the workspace, ending on .edit, additionally the model code should be created in the “src” folder of your base project.

Now we may start with the graphical part, defining the notation symbols and map them to the model. In the eclipse menu, click on “Window” -> “Show View” -> “Other”. Select “GMF Dashboard” inside the “General” folder. The following view should open:

The GMF dashboard.

The GMF dashboard.

We start from “Domain Gen Model” – click on “Select” and choose the .genmodel file, which we created. After, click on “Select” in “Domain Model” and choose the EMF .ecore file, which we created. After that, click “Create” inside “Graphical Def Model”. Select again the “model” folder in the opening view and set the name to “businessprocess.gmfgraph”.

Creation of the GMFGraph model.

Creation of the GMFGraph model.

A new file will open, which contains an element in a list view, called “Canvas”. Right-click on “Canvas” and add a “Figure Gallery”:

Adding a Figure Gallery in GMFGraph.

Adding a Figure Gallery in GMFGraph.

Right click the created “Figure Gallery” and add three times “Figure Descriptor”. Use the properties of the first one and give it the name “Rectangle”, use the properties of the second one and give it the name “Ellipse” and the properties of the last one to call it “Connection”. Right-Click the first “Figure Descriptor”, select “Add Child” and add the Rectangle. Right-Click the second “Figure Descriptor”, select “Add Child” and add the Ellipse. Right-click again the “Figure Gallery” and add a “Polyline Decoration”. Use the properties to call it “connection decoration”. Right-click the “Polyline Decoration” and add a “Polygon”. Right-click the “Figure Descriptor Connection” and add a “Polyline Connection”. Use the properties to set the name to “sequence” and the “Target Decoration” to “Polyline Decoration connection decoration”. After being successful, the .gmfgraph file should look like this:

Updated gmfgpraph file, containing the Figure Gallery.

Right-Click again on the “Canvas” element and insert two children of the type “Node”. Use the properties of the first Node to give it the name “event”, in the dropdown next to “Figure” choose the “Figure Descriptor Rectangle”. Give the second Node the name “processStep” and choose the Figure “Figure Descriptor Ellipse”. This means, that events will be represented by Ellipses and processSteps by Rectangles.

Right-Click on “Canvas” and add a child “Connection”. Use the properties to give it the name “sequence” and set “Figure” to “Figure Descriptor Connection”. Use right-click on “Canvas” to add three times “Diagram Label”. Using the properties, the first Label should get the name “eventName”, the second label “processStepName” and the last label “sequenceLabel”. The GMFGraph model should now look like this:

Complete GMFGprah model.

Going back to the GMF Dashboard, click on “Create” in “Tooling Def Model”. In the opening view, select the “model” folder and give it the name “businessprocess.gmftool”.

Creating the GMF tooling file.

Creating the GMF tooling file.

The created file will already contain an element “Tool Registry” in a list view. Right-click the “Tool Registry” and add a child “Palette”. Right click the “Palette” and add three children “Creation Tool”. Use the properties, set the title of the first “Creation Tool” to “event”, the title of the second “Creation Tool” to “processStep” and the title of the third to “sequence”. The file should look like this:

Creation of the GMF tooling file.

Right-Click the “model” folder of the project, select “New” -> “Other” and choose “Guide Mapping Model Creation” in the opening view, it is inside the folder “Graphical Modeling Framework”.

Add the Guide Mapping Model Creation to the model folder of the project.

Add the Guide Mapping Model Creation to the model folder of the project.

Make sure, that the folder “model” is selected and choose the name “Creation of the GMF tooling file”.

Adding the file gmfmap to the project.

Adding the file gmfmap to the project.

Leave the next view like it his and click “Next”, the view should look like this:

The Select Domain Model model view while creating the GMFMap model.

The Select Domain Model model view while creating the GMFMap model.

Leave the following two views also like they are. The last view shows the mapping and should look like this:

The mapping when creating the GMFMap file.

Click on the right side on “Sequence (sequence; sequences)” and click the button “Change”. Set the “Source Feature” to “EReference source” in the opening dialogue.

Set the source feature to ERference source.

Set the source feature to ERference source.

Click “Finish” to create the file and open it. We need to make some manual amendments, i.e. adding the labels and fixing the mapping from processStep to Ellipse (because now both event and processStep are assigned to Rectangle).

Choose the mapping, which contains “Top Node Reference <shapes:ProcessStep/event>”. Open all children and open the properties of “Node Mapping <ProcessStep/event>”.

Altering the properties of the GMFMap model.

Altering the properties of the GMFMap model.

In the properties, change “Diagram Node” from “Node event (Rectangle)” to “Node processStep (Ellipse)”.

Altering mapping properties.

Altering mapping properties.

After, select the “Feature Label” of the three mappings and assign the processStepName label to the processStep, the eventName label to the event and the sequenceLabel to the sequence.

Example of the Diagram Label assignment.

Example of the Diagram Label assignment.

After this is done, right click on the first element of the list and click on “Create generator model”.

Create the generator model.

Create the generator model.

In the following view, be sure that the “model” folder is selected and choose the name “businessprocess.gmfgen”.

Create the generator model .

Create the generator model.

Don’t change nothing in the following views, click next until you are able to click Finish. After clicking “Finish”, the file “businessprocess.gmfgen” should be available in the “model” folder. Open the file, right-click the first element and click “Generate Diagram Code”.

Generate the diagram code from the gmfgen file.

Generate the diagram code from the gmfgen file.

Your workspace should now contain a new project ending in “.diagram”. Right-click the project and click on “Run as” and choose “Eclipse application”.

Run the .diagram project as eclipse application.

Run the .diagram project as eclipse application.

After the new eclipse instance opened, click the “New” icon and search for “Businessprocess Diagram” in the “Examples” folder.

Add a new businessprocess diagram.

Add a new businessprocess diagram.

Now you are able to create a very basic process diagram, which consists of events and processSteps. You can use “sequence” in the “palette” to connect single symbols.

Create a basic process.

Use node.js and bower in the IntelliJ IDEA IDE

Here are some clues, how to use node.js and bower in the jIDEA IDE. I need to use it for managing packages in a project for my bachelor thesis. There I use the set up to manage libraries like angularjs, bootstrap and lawnchair.

Nodejs installlation and plugin support in jIDEA

First of all, install node.js – the installer files are provided from their homepage. After that, open jIDEA and go to the settings (IDE Settings -> Plugins) and make sure that “NodeJS” is installed – if not, install it from here:

Install the NodeJS plugin from the settings.

Install the NodeJS plugin from the settings.

Install bower

In my case (Mac OS 10.9.2), node.js was installed to /user/local/bin. Install bower globally by running the following in command line:

/user/local/bin/npm install -g bower

You will maybe require admin/sudo rights to run this command! The output in the command line will show, if the installation was successful.

Use bower package manager in a project

Assuming you already added the project in jIDEA, use the command line and cd the project directory. Simply run

bower init

some questions need to be answered on the command line – after that the bower.json file will be added to the project root. Now you can go back to the IDE and open the settings (Project Settings -> JavaScript -> Bower). Fill out the three required fields “Node interpreter”, “Bower executable” and “bower.json”.

Make the settings for bower in jIDEA.

Make the settings for bower in jIDEA.

Add packages with bower

Since bower is set up for the project, you can easily add packages. From the projects settings you may click the plus, to add a package. After clicking the plus, another window will open showing all the available packages. A great benefit is also the dependency management – if you install a package which depends on another package – the dependency will be installed automatically.

Workaround: Twitter application write access when mobile number is not accepted from the Twitter website

I recently added a Twitter application and I needed it to have write access, so it can use the service to follow users on Twitter. This service requires the application to have write access so I just tried switching to write access from the backend. This changed requires having the mobile number saved in the Twitter account. Since I am living in Bulgaria and my current carrier is Globul, I was not able to add the phone number – I got the message:

Sorry, we don’t have a connection to your mobile provider yet!
Don’t worry, we’re on it and will let you know once things are set up. In the meantime, use one of our long codes. Learn more (https://support.twitter.com/articles/14226-how-to-find-your-twitter-short-code-or-long-code)

There doesn’t seem to be a way to work around this. Several users are talking about that in the forum, another user blogs about it here.

Anyway, there is a workaround for that problem. In order to use this workaround, you need to have a smart phone and install the Twitter mobile application. This workaround works for me in iOS – it also seems to work in Android like people report in the Twitter forum. Like this you will be able to switch to Twitter application write access, although the Twitter websites doesn’t accept your phone number.

After installing the Twitter mobile application, go to the tab on the right, it’s the screen showing your user details. Hit the wheel (it’s shown under the amount of tweets) and click “Settings”.

User screen of the Twitter mobile application

User screen of the Twitter mobile application.

After clicking on “Settings”, another view opens where you have to click on your account.

This view shows the settings of your account in the Twitter application.

This view shows the settings of your account in the Twitter application.

The following view shows the options for your Account – scroll all the way down and click “Security”.

This view shows the account options, on the bottom you can find "Security".

This view shows the account options, on the bottom you can find “Security”.

After hitting the Security option, the application will ask you to add a phone:

This view opens after selecting Security when no phone number was added yet.

This view opens after selecting Security when no phone number was added yet.

After clicking “Add phone”, the mobile browser will open and require you to insert your phone number:

Here you have to insert your phone number and press save.

Here you have to insert your phone number and press save.

After adding the phone number and pressing save, wait a few minutes. Twitter will send you a link to the phone number you just added to verify it. After clicking the link in the SMS the phone number is approved and you should be able to switch the application access to “write”.

Use htaccess to put a site in maintenance mode

The following article explains, how to use the htaccess file in order to put a site or a part of the site in maintenance mode. I use to find myself in the position, where I need to put a site, or a part of a site, in maintenance mode to do changes on a productive server. This usually requires to block the whole site or certain parts and allow only my IP address, or several IP address of people working on the server to be allowed. On the one hand, this could be achieved via the Apache (v)host configuration. It is also possible to do it via the htaccess file, most of the times access is given. Furthermore, changing the htaccess file doesn’t require a restart of the web server afterwards.

If I want to block access to the whole site, I usually use the following htaccess configuration:

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.php
RewriteCond %{REMOTE_ADDR} !=111.111.111.111
RewriteRule ^.*$ /maintenance.php [R=302,L]

The rules are rather easy: The first RewriteCond checks, if something else than maintenance.php is requested. The second RewriteCond checks, if the IP address is anything else than 111.111.111.111 (my IP address, but changed).  So: If the user is not me and requested something else than maintenance.php, he will be redirected to maintenance.php. There I usually output a message, that the site is currently under maintenance.

If just a certain part of the site needs to be blocked, for example “/forum”, the first RewriteCond of the htaccess file can be changed accordingly:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} /forum
RewriteCond %{REMOTE_ADDR} !=111.111.111.111
RewriteRule ^.*$ /maintenance.php [R=302,L]

This will block the /forum and any subfolder for every IP except 111.111.111.111. I recommend using R=302 (temporarily moved) instead of R=301 (permanent) redirect, because browsers tend to cache rewrite rules which are defined as R=301. This may cause persistent redirects to maintenance.php, also if the maintenance work is finished and the rules are removed/commented again.

It is also possible to include several IP addresses:

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.php
RewriteCond %{REMOTE_ADDR} !=111.111.111.111
RewriteCond %{REMOTE_ADDR} !=222.222.222.222
RewriteCond %{REMOTE_ADDR} !=333.333.333.333
RewriteRule ^.*$ /maintenance.php [R=302,L]

More information about htaccess and mod-rewrite can be found on the Apache homepage.

stackoverflow plugin for wordpress (stackoverflow+)

Recently I wanted to display my stackoverflow account details on my blog – I found the plugin stackoverflow+ which I liked from the screenshots. After installing, it didn’t work. The widget itself displayed, but all the fields it should receive from stackoverflow stayed empty. After viewing the sources I noticed that my hosting didn’t provide zlib, so I implemented and alternative implementation to use curl, in case zlib is not available. The file wsp-functions.php will now look like this:

<?php

function sanitizeObject($d)
{
    if (is_object($d)) {
        $d = get_object_vars($d);
    }
    if (is_array($d)) {
        return array_map(__FUNCTION__, $d);
    } else {
        return $d;
    }
}

/**
 * Uses the Stackoverflow API to get certain data
 *
 * @param string $ids
 * @param string $type
 * @return array|mixed
 */
function getUserData($ids, $type = '')
{
    // Define Local Variables
    $site = 'stackoverflow';
    $baseurl = 'http://api.stackexchange.com/2.2/users/';
    $apikey = 'sbI47iM9fyMqLqD0sA2T8A((';

    //Construct Url and Get Data off SO and use Sanitizer.
    if ($type == '') {
        $url = $baseurl . $ids . '?key=' . $apikey . '&site=' . $site . '&order=desc&sort=reputation&filter=default';
    } else if ($type == 'byQuestionids') {
        $url = 'http://api.stackexchange.com/2.2/questions/' . $ids . '?key=' . $apikey . '&site=' . $site . '&order=desc&sort=activity';
    } else {
        $url = $baseurl . $ids . '/' . $type . '?key=' . $apikey . '&site=' . $site . '&order=desc&sort=activity&filter=default';
    }
    if (function_exists('curl_version') === true)
        $results = json_decode(getJsonFromUrl_curl($url));
    else
        $results = json_decode(getJsonFromUrl_zlib($url));
    $results = sanitizeObject($results);
    return $results;
}

/**
 * Gets the json data from the given URL (curl implementation)
 *
 * @param string $url URL as string
 * @return string returns the json data as string
 */
function getJsonFromUrl_curl($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}

/**
 * Gets the json data from the given URL (zlib implementation)
 *
 * @param string $url URL as string
 * @return string returns the json data as string
 */
function getJsonFromUrl_zlib($url) {
    $context = array('http'=>array('header'=>"Accept-Encoding: gzip\r\n"));
    $url = "compress.zlib://" . $url;
    return file_get_contents($url, false, $context);
}

?>

What happens: In line 37 we do a check to see, if curl is available on the server. If yes, the function “getJsonFromUrl_curl($url)” is called, so the stackexchange API  is consumed using curl. If curl is not available, it will use “getJsonFromUrl_zlib($url)”, doing the same using zlib. This procedure requires either curl or zlib to be installed.

In the file “stackoverflow-plus.php” I implemented a check for zlib and curl on plugin activation. If neither is available, plugin activation will fail with a message to the user “Either zlib or curl needs to be installed on the server!”.

<?php
/*
Plugin Name: Stackoverflow+
Plugin URI: http://techstricks.com/wp-plugins/
Description: Stackoverflow Plus integreates your <a href="http://www.stackoverflow.com">Stackoverflow</a> profile with your word press website. Show your Stackoverflow profile, Questions, Answers, Reputation, Badges and much more through a easy to configure widget.
Version: 1.0
Author: Amyth Arora
Author URI: http://www.techstricks.com
*/

load_plugin_textdomain('wordpress-stackoverflow-plus');

if (!defined('WSP_VERSION')) {
    define('WSP_VERSION','1.0');
}
if (!defined('WSP_AUTHOR')) {
    define('WSP_AUTHOR','Amyth Arora');
}
// import the Widget Class
require_once( plugin_dir_path( __FILE__ ) . 'wsp-widget.php');

//Add the Stylesheet
add_action('wp_enqueue_scripts', 'add_wsp_style');
function add_wsp_style(){
    wp_register_style('wsp-style', plugins_url('css/stackoverflow-plus.css', __FILE__));
    wp_enqueue_style('wsp-style');
}

function stackoverflowplus_activate() {
    if (function_exists('curl_version') === false && function_exists('gzcompress') === false ) {
        echo 'Either zlib or curl needs to be installed on the server!';
        die;
    }
}
register_activation_hook( __FILE__, 'stackoverflowplus_activate' );
?>

I also turned off the accept rate from the widget settings, it doesn’t seem to be provided anymore, see this link. Please note that I only did the modifications for curl – the plugin itself was written by @mytharora.

Installing Adobe Media Server 5.0.3 on Linux with preinstalled Apache Server

I wanted to try the Adobe Media Server for streaming videos. On the development machine, Apache was already preinstalled. Adobe describes on their page, what to regard in order to install AMS (Adobe Media Server), when Apache is already installed (Use an external Apache HTTP Server for HTTP Dynamic Streaming and HTTP Live Streaming). The instructions don’t seem to be complete, here are some things I had to figure out:

The apache modules: On the page they list some windows libraries (dll) and some shared objects (so). Since I am using Ubuntu 12.04, I didn’t have any of the dlls. I ended up copying the three shared objects, in my case to:

/usr/lib/apache2/modules/mod_f4fhttp.so
/usr/lib/apache2/modules/mod_hlshttp.so
/usr/lib/apache2/modules/mod_jithttp.so

The modules are loaded through the httpd.conf file:

# Load required modules for Adobe Media Server
LoadModule f4fhttp_module /usr/lib/apache2/modules/mod_f4fhttp.so
LoadModule hlshttp_module /usr/lib/apache2/modules/mod_hlshttp.so
LoadModule jithttp_module /usr/lib/apache2/modules/mod_jithttp.so

After that, I figured out step by step what other modules I have to add in order to get it running, here’s the list:

unzipped-adobemediaserver-package/Apache2.2/modules/libadbe_dme.so
unzipped-adobemediaserver-package/Apache2.2/modules/libadbe_license.so
unzipped-adobemediaserver-package/Apache2.2/modules/libasneu.so.1
unzipped-adobemediaserver-package/Apache2.2/modules/libcrypto.so.1.0.0
unzipped-adobemediaserver-package/Apache2.2/modules/libexpat.so.1.5.2
unzipped-adobemediaserver-package/Apache2.2/modules/libhds.so

The listed modules need to be copied to the apache modules folder (in my case /usr/lib/apache2/modules). After that, apache configtest was still complaining about two missing libraries: libcares.so.2 and libexpat.so.0.

libcares.so.2 can be easily installed via sudo apt-get install libc-ares2, check pkgs.org for more information. On the fly I didn’t find a way to get libexapt.so.0 for Ubuntu 12.04, so I just copied libexpat.so.1.5.2 to libexpat.so.0 on the development machine (not recommended to do so).

After installing the libraries, I was able to start Apache, so I made the vhost configuration for the host using Adobe Media Server. The configuration can be found also on the adobe homepage. I copied the following:

<IfModule f4fhttp_module>
<Location /hds-live>
 HttpStreamingEnabled true
 HttpStreamingLiveEventPath "../applications"
 HttpStreamingContentPath "../applications"
 HttpStreamingF4MMaxAge 2
 HttpStreamingBootstrapMaxAge 2
 HttpStreamingFragMaxAge -1
 HttpStreamingDrmmetaMaxAge 3600
 Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule hlshttp_module>
<Location /hls-live>
 HLSHttpStreamingEnabled true
 HttpStreamingLiveEventPath "../applications"
 HttpStreamingContentPath "../applications"
 HLSMediaFileDuration 8000
 HLSSlidingWindowLength 6
 HLSAmsDirPath ".."
 HLSM3U8MaxAge 2
 HLSTSSegmentMaxAge -1
 Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule jithttp_module>
<Location /hds-vod>
 HttpStreamingJITPEnabled true
 HttpStreamingContentPath "../webroot/vod"
 JitAmsDirPath ".."
 Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule hlshttp_module>
<Location /hls-vod>
 HLSHttpStreamingEnabled true
 HLSMediaFileDuration 8000
 HttpStreamingContentPath "../webroot/vod"
 HLSAmsDirPath ".."
 Options -Indexes FollowSymLinks
</Location>
</IfModule>

After adding these, restarting Apache was not possible, apache gave me the following message:

Invalid command 'HLSAmsDirPath', perhaps misspelled or defined by a module not includedin the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

I didn’t find any answers on Google, so I started to view the httpd.conf which is shipped with the package:

unzipped-adobemediaserver-package/Apache2.2/conf/httpd.conf

I found out that they use the commands “HLSFmsDirPath” instead of “HLSAmsDirPath” and “JitFmsDirPath” instead of “JitAmsDirPath”. After changing these two values apache successfully started and the video streaming over http is working.

My vhost configuration file looks like this (extracted):

<IfModule f4fhttp_module>
<Location /hds-live>
 HttpStreamingEnabled true
 HttpStreamingLiveEventPath "/opt/adobe/ams/applications"
 HttpStreamingContentPath "/opt/adobe/ams/applications"
 HttpStreamingF4MMaxAge 2
 HttpStreamingBootstrapMaxAge 2
 HttpStreamingFragMaxAge -1
 HttpStreamingDrmmetaMaxAge 3600
 Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule hlshttp_module>
<Location /hls-live>
 HLSHttpStreamingEnabled true
 HttpStreamingLiveEventPath "/opt/adobe/ams/applications"
 HttpStreamingContentPath "/opt/adobe/ams/applications"
 HLSMediaFileDuration 8000
 HLSSlidingWindowLength 6
 HLSFmsDirPath "/opt/adobe/ams"
 HLSM3U8MaxAge 2
 HLSTSSegmentMaxAge -1
 Options -Indexes FollowSymLinks
</Location>
<Location /hls-vod>
 HLSHttpStreamingEnabled true
 HLSMediaFileDuration 8000
 HttpStreamingContentPath "/opt/adobe/ams/webroot/vod"
 HLSFmsDirPath "/opt/adobe/ams"
 Options -Indexes FollowSymLinks
</Location>
</IfModule>
<IfModule jithttp_module>
<Location /hds-vod>
 HttpStreamingJITPEnabled true
 HttpStreamingContentPath "/opt/adobe/ams/webroot/vod"
 JitFmsDirPath "/opt/adobe/ams"
 Options -Indexes FollowSymLinks
</Location>
</IfModule>