This section describes the Cherokee configuration files format. It shows the key entries and the expected behavior of all of them.
Contents |
When the server starts it opens a port for start listening the incoming requests. By default this is the port 80. By default it will use all the network interfaces of the machine, which is usually the desired behavior. Anyway, it is possible to customize this using the Port and Listen configuration entries.
To attend port 81 instead of the port 80, just use:Port 81It is also possible to set a listening interface. To make the server accept connections only with one of the interface, for example, 193.127.101.100 just use:
Listen 193.127.101.100
IPv6 off
The User directive configures which user the Cherokee daemon will normally run as. By default, Cherokee runs as root which is considered undesirable in all but the most trustful network configurations. The User directive used in conjunction with the Group directive instructs the daemon to switch to the specified user and group as quickly as possible after startup. It is only possible to change the user and/or group if the server runs initially as root, otherwhise it will change it. There are two possible formats: using the user or group name, or using the system ID.
For example, to set the User and Group to "www-data":User www-data Group www-dataIt is also possible to use a system user and/or group ID, for example:
User 65534 Group 65534
DocumentRoot /var/www/
then an access to http://www.example.com/index.html refers to /var/www/index.html. There are methods to change this default behavior, take a look at the Directory keyword for more information.
The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist, the server will reply according to the handler behavior.
DirectoryIndex index.html
then a request for http://www.example.com/docs/ would return http://www.example.com/docs/index.html if it exists, or would list the directory if it did not.
Note that the documents do not need to be relative to the directory:DirectoryIndex index.html index.txt /cgi-bin/index.plwould cause the CGI script /cgi-bin/index.pl to be executed if neither index.html or index.txt existed in a directory.
There is an special case in which the directory index entry starts with a slash. For example, /cgi-bin/index.pl. In that case, it will use it as the object accessible under that public address of the same virtual server, so it will take care about the possible configuration of the /cgi-bin/ directory and/or the pl extension.
PidFile /var/run/cherokee.pidIf this configuration entry is not used, Cherokee won't write the file down.