Skip to content
it4e edited this page Mar 21, 2016 · 9 revisions

This is a detailed post on how to install and configure CHL on your system. As of now CHL is only officially available on Linux, but I am planning to port it to other operating systems as well if the interest is big enough. Otherwise you could of course make a port of it yourself, see contribute.

Contents

This is for those of you who use a distribution of Linux, whether Ubuntu, Debian or Fedora, this will work for all Linux distributions. A little knowledge of how to use the Terminal and how to navigate the filesystem might be a good thing to have in your bagage, although not required to follow this guide.

Apache2

First you will want to enable CGI scripts in the Apache2 configuration file (/etc/apache2/apache2.conf).

vim /etc/apache2/apache2.conf

Look for a line that says: "<Directory /var/www/>". Add the following inside of it:

Options +ExecCGI
AddHandler cgi-script .chl

This tells Apache to handle all files with the .chl ending as CGI scripts.

Now you will have to enable the CGI module as well.

a2enmod cgi

Restart Apache and you are good to go.

service apache2 restart

This is how you download a copy of CHL using Git and a terminal. If you prefer to do it manually, see manual download

Clone CHL: https://github.com/it4e/CHL

git clone https://github.com/it4e/CHL

This will create a folder named 'CHL', in your current working directory

You can download CHL as a zip or tar.gz file manually, from the releases page. Unzip it and you are good to go.

Once you have downloaded the CHL source files you are ready to install CHL. Go ahead and change to the CHL directory containing all of the source files you just downloaded using a Terminal.

cd CHL

Issue the following command to finish the installation process. (Make sure to run as root)

sudo make install

This will compile all the files inside 'core/'* to their corresponding object files. The object files will then be smashed into a statically linked library ('libchl.a'), which is then copied into '/usr/lib/chl/.'. The standard CHL header 'chl.h' is also moved, to '/usr/include/chl/.'

Open file '/etc/apache2/sites-available/000-default.conf', alt. '/etc/apache2/sites-available/default' for editing.

vim /etc/apache2/sites-available/000-default.conf

Change the DirectoryIndex of <VirtualHost *:80> to include 'index.chl'

<virtualhost *:80>

  ServerName  domain.com
  ServerAlias www.domain.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex home.html index.html index.chl
  DocumentRoot /var/www

</virtualhost>

Restart Apache2 to enable changes

service apache2 restart

Now that you have successfully installed CHL on your system, learn how to use CHL here: tutorial, get started

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally