H5ai

From SME Server
Revision as of 11:12, 27 June 2015 by RequestedDeletion (talk | contribs) (WIP)
Jump to navigationJump to search

About

h5ai is a modern file indexer for HTTP web servers with focus on your files. Directories are displayed in a 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

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.


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.


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-ustom directory:

mkdir -p /etc/e-smith/custom-templates/etc/httpd/httpd/conf/WebappVirtualHost

and create the template fragment:

nano -w /etc/e-smith/templates-custom/etc/httpd/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

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 setprop files.myserver.com TemplatePath WebAppVirtualHost \
DocumentRoot /home/e-smith/files/ibays/depot/html \
DirectoryIndex /_h5ai/server/php/index.php


h5ai

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

Once the _h5ai directory is in place, we can now update the apache vrtual 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.