Cherokee Web Server: Configuration

Configuration

The configuration files of Cherokee are usually placed on /etc/cherokee, but it might change depending on the distribution or installation parameters. By default there are a few configuration files, each one with a a main target, but that is only the default configuration. Cherokee supports inclusion of configuration files, so you are free to write down a never ending configuration file with tens of virtual hosts inside it, or to split it up in separate files.

There are three different configuration file


The most interesting file is cherokee.conf. It file support to include files and directories, so the default configuration in splitted in a few files to make the configuration easier:


The virtual servers configuration is contained in two directories:


There is also a container for extended functionalities:


How to add a new virtual host

Let imagine you want to add a virtual server called example.com.

Server example.com, www.example.com {
    DocumentRoot /var/www/example.com
   
    Directory / {
        Handler file
    }    

    Extension php, php4 {
        Handler phpcgi
    }
}
cd /etc/cherokee/sites-enabled
ln -s /etc/cherokee/sites-available/example.com .