Difference between revisions of "H5ai"

From SME Server
Jump to navigationJump to search
(WIP)
(→‎h5ai: update latest version)
 
(16 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
====sub domain====
 
====sub domain====
 
The h5ai indexer does not work with web server aliases (Ibay used as web content), so we need to create a (sub) domain (Apache virtual host), e.g. files.myserver.com. This domain can be created through the server manager. In this example we will use ''files.myserver.com'', mapped to an ibay called ''depot'', so please create the ibay ''depot'' first and then your domain with the ''depot'' ibay as primary content through server manager.
 
The h5ai indexer does not work with web server aliases (Ibay used as web content), so we need to create a (sub) domain (Apache virtual host), e.g. files.myserver.com. This domain can be created through the server manager. In this example we will use ''files.myserver.com'', mapped to an ibay called ''depot'', so please create the ibay ''depot'' first and then your domain with the ''depot'' ibay as primary content through server manager.
 +
 +
So:
 +
* create an ibay with php execution enabled
 +
* create a new domain in server manager where the content points to the created ibay
  
  
Line 17: Line 21:
 
  yum install smeserver-webapps-common --enablerepo=fws
 
  yum install smeserver-webapps-common --enablerepo=fws
  
====custom template====
 
Once the sub domain and ibay are created and smeserver-webapps-common is installed, we need to create a custom template to add an important directive to the virtual host. Firstly we need to create the template-custom directory:
 
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/WebAppVirtualHost
 
and create the template fragment:
 
nano -w /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/WebAppVirtualHost/60DirectoryIndex
 
 
and add the following content and save the file:
 
{
 
use esmith::util;
 
my $dindex = $domain->prop('DirectoryIndex') || '';
 
if ($dindex ne ' '){
 
    $OUT .= "    DirectoryIndex $dindex\n";
 
}
 
}
 
  
 
====Virtual host====
 
====Virtual host====
 
+
Once the contrib smeserver-webapps-common has been installed from the FWS repo, we can create the required virtual host as follows:
Once the contrib smeserver-webapps-common has been installed from the FWS repo and the custom template ahs been created, we can create the required virtual host as follows:
+
  db domains set files.myserver.com domain TemplatePath WebAppVirtualHost \
  db domains setprop files.myserver.com TemplatePath WebAppVirtualHost \
+
  DocumentRoot /home/e-smith/files/ibays/depot/html DirectoryIndex /_h5ai/server/php/index.php
  DocumentRoot /home/e-smith/files/ibays/depot/html \
+
These are the minimum settings required. For more options see [[Webapps-common|'''smeserver-webapps-common''']].
DirectoryIndex /_h5ai/server/php/index.php
 
  
  
 
===h5ai===
 
===h5ai===
Now that all preparations have been done, we can install the h5ai indexer itself. The latest version can be downloaded from [https://release.larsjung.de/h5ai/h5ai-0.27.0.zip '''here''']. The unzipped directory (_h5ai) needs to be placed in the html directory of the ''depot'' ibay and the correct permissions have to be set. So after copying the _h5ai directory into /home/e-smith/files/ibays/depot/html one can set the correct permissions from within the html directory with:
+
{{Note box|Please note that currently SME Server comes with PHP 5.3.3 and version 0.27.0 is the last version that can be used out of the box. If you would like to install version higher then 0.27.0, PHP 5.5.0+ is required. To install PHP 5.5.0+ on your SME Server please see [[Software Collections]]}}
 +
 +
Now that all preparations have been done, we can install the h5ai indexer itself. The latest version can be downloaded from [https://release.larsjung.de/h5ai/h5ai-0.29.0.zip '''here''']. The unzipped directory (_h5ai) needs to be placed in the html directory of the ''depot'' ibay and the correct permissions have to be set. So after copying the _h5ai directory into /home/e-smith/files/ibays/depot/html one can set the correct permissions from within the html directory with:
 
  chown -R www:www _h5ai
 
  chown -R www:www _h5ai
 +
and remove any other index.xxx file that is currently present in the html directory.
  
 
Once the _h5ai directory is in place, we can now update the apache virtual host to use the h5ai indexer:
 
Once the _h5ai directory is in place, we can now update the apache virtual host to use the h5ai indexer:
 
  signal-event webapps-update
 
  signal-event webapps-update
  
From here you can visit your new domain ''http://files.myserver.com'' and see the new indexer in action. Everything you upload to the ''depot'' ibay will be shown by the h5ai indexer, including subdirectories like in the screenshot above.
+
From here you can visit your new domain ''http://files.myserver.com'' and see the new indexer in action. Everything you upload to the ''depot'' ibay will be shown by the h5ai indexer, including sub directories like in the screenshot above.
  
 
==Configuration==
 
==Configuration==
Line 55: Line 47:
 
For displaying video, ''ffmpeg'' is required. ffmpeg is available from the [[ATrpms | '''ATrpms''']] repository. Please see the [[ATrpms | '''ATrpms''']] page on how to enable this repo. Once enabled, ffmpeg can be installed with:
 
For displaying video, ''ffmpeg'' is required. ffmpeg is available from the [[ATrpms | '''ATrpms''']] repository. Please see the [[ATrpms | '''ATrpms''']] page on how to enable this repo. Once enabled, ffmpeg can be installed with:
 
  yum install ffmpeg --enablerepo=atrpms
 
  yum install ffmpeg --enablerepo=atrpms
 +
  
 
===Combinations===
 
===Combinations===

Latest revision as of 04:00, 1 July 2017

About

h5ai is a modern file indexer for HTTP web servers with focus on your files. Directories are displayed in an appealing way and browsing them is enhanced by different views, a breadcrumb and a tree overview. A demo can be seen here.

H5ai-1.png

h5ai showing an ibay on SME Server 9.1beta1


Installation

Preperation

sub domain

The h5ai indexer does not work with web server aliases (Ibay used as web content), so we need to create a (sub) domain (Apache virtual host), e.g. files.myserver.com. This domain can be created through the server manager. In this example we will use files.myserver.com, mapped to an ibay called depot, so please create the ibay depot first and then your domain with the depot ibay as primary content through server manager.

So:

  • create an ibay with php execution enabled
  • create a new domain in server manager where the content points to the created ibay


webapps common

The easy way to create and manage virtual hosts is using the contrib smeserver-webapps-common from the FWS repository so this repo needs to be enabled first. Please see here on how to enable the FWS repository. Once enabled, the contrib can be installed as follows:

yum install smeserver-webapps-common --enablerepo=fws


Virtual host

Once the contrib smeserver-webapps-common has been installed from the FWS repo, we can create the required virtual host as follows:

db domains set files.myserver.com domain TemplatePath WebAppVirtualHost \
DocumentRoot /home/e-smith/files/ibays/depot/html DirectoryIndex /_h5ai/server/php/index.php

These are the minimum settings required. For more options see smeserver-webapps-common.


h5ai

Important.png Note:
Please note that currently SME Server comes with PHP 5.3.3 and version 0.27.0 is the last version that can be used out of the box. If you would like to install version higher then 0.27.0, PHP 5.5.0+ is required. To install PHP 5.5.0+ on your SME Server please see Software Collections


Now that all preparations have been done, we can install the h5ai indexer itself. The latest version can be downloaded from here. The unzipped directory (_h5ai) needs to be placed in the html directory of the depot ibay and the correct permissions have to be set. So after copying the _h5ai directory into /home/e-smith/files/ibays/depot/html one can set the correct permissions from within the html directory with:

chown -R www:www _h5ai

and remove any other index.xxx file that is currently present in the html directory.

Once the _h5ai directory is in place, we can now update the apache virtual host to use the h5ai indexer:

signal-event webapps-update

From here you can visit your new domain http://files.myserver.com and see the new indexer in action. Everything you upload to the depot ibay will be shown by the h5ai indexer, including sub directories like in the screenshot above.

Configuration

h5ai is able to create thumbnail previews for several files, e.g. pdf files, pictures and videos. For pdf thumbnail previews ImageMagick is required. To install ImageMagick one can issue:

yum install ImageMagick

For displaying video, ffmpeg is required. ffmpeg is available from the ATrpms repository. Please see the ATrpms page on how to enable this repo. Once enabled, ffmpeg can be installed with:

yum install ffmpeg --enablerepo=atrpms


Combinations

Interesting combinations are possible. A webDAV directory or the SharedFolders contrib would get a nice UI on any (portable) device. In combination with FolderSync for android, backing up your Whatsapp/Camera photo's is a breeze and gives the 'home front' an immediate insight through a pleasurable UI on any device.

H5ai-2.png