Skip to content
it4e edited this page Feb 26, 2017 · 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. A little knowledge on 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. Look through the file etc/apache2/apache2.conf until you find a line that says: "<Directory /var/www/>".

vim /etc/apache2/apache2.conf

Add the following inside of "<Directory /var/www/>":

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

We will be using the Apache mod_fastcgi module, and the first thing we will want to do is install it.

Ubuntu

sudo apt-get install libapache2-mod-fastcgi

After the installation has complete we need to configure Apache2 to enable the FastCGI module.

Edit the file /etc/apache2/apache2.conf, and add this text anywhere on a new line:

LoadModule fastcgi_module modules/mod_fastcgi.so

You also want to look for a line that says "<Directory /var/www/>" and add the following into the block:

Options +ExecCGI
<IfModule fastcgi_module>
  AddHandler fastcgi-script .chl .fchl # DONT USE .chl ON BOTH CGI AND FastCGI
</IfModule>

Lastly, you will need to issue the following commands to enable the settings

a2enmod fastcgi
service apache2 restart

https://wiki.archlinux.org/index.php/Apache_and_FastCGI

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

or for FastCGI:

sudo make TYPE=FCGI install

Set the variable PLUGINS to FALSE: PLUGINS=FALSE, if you do not want any plugins to be installed.

This will compile all the files inside 'core/', as well as any plugin files if not PLUGINS is set to FALSE, to their corresponding object files. The object files will then be smashed into a linked library ('libchl.so'), 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