Virtual Server

'Virtual Server' is an abstraction mechanism that allows you to define a custom number of parameters and rules that have to be applied to one or more domains.

In a Cherokee server there must be at least one virtual server named default, and there is no maximum number. It is important to know that this server cannot be deleted.

When the server receives a request it will try to match the domain name specified in the virtual server that should handle it. In case no virtual server matches the request, default will be used.

Add a new Virtual Server

You have to enter the server name and a valid Document Root directory in order to create a new virtual server.

Virtual server

Now, we can configure our new virtual server.

Basics

Domain names

This section allows to define the list of domains that the virtual server implements.

It can accepted either FQDN or wild cards entries. For instance:

  example.com
*.example.org

Behavior

This sections allows to define a set of rules to define how the server should handle the different requests. These rules can be defined based on the directory that the request targets, the extension of the file that it is requesting, or a regular expression that may match with the request:

It is very important to know that this rules are prioritized, the bigger its priority is, the sooner that are checked against. You could think of a network routing table, it is quite similar.

Virtual server

Each of these behavior rules must specify which is the handler that the server should use to reply the requests that matches the rule. Handler are the modules that generate the information with which the server responses a client request. By default Cherokee provide a number of them:

Error Handler

We can easily redirect errors to a custom path or website.

Virtual server

Logging

The loggers are a type of Cherokee modules to write the server log information using different destinations and/or formats:

If a virtual server doesn't have a logger set up it will not log anything.

Virtual server

By default Cherokee ships three loggers implementing three different logging formats:

Security

The virtual server must be configured with the path to the certificate before using secure connections (https). There is a document which might help to generate SSL keys

FQDN: Full Qualified Domain Names