Configuring Virtual Hosts

3.2. Configuring Virtual Hosts

For Monkey, everything is a virtual host. These are defined by creating a configuration file under conf/sites/ directory. Thus, a minimal web server equals to having only one virtual host; for that end is required the existence of at least one virtual host definition-file called 'default'.

The available options for virtual host configuration files are the following:

  • DocumentRoot: Defines the base directory for the virtual host. In other words, where in the filesystem is placed its content.

  • Servername: Sets the the virtual host identifier (e.g. mysite.example.com). Like a Tip, you can experiment with virtual hosts in the local machine by adding lines to your /etc/hosts file, for example:

    
      127.0.0.1   mysite_1
          127.0.0.1   mysite_2
        

    Then, if you start your web browser and go to http://mysite_1 you get one thing, and going to http://mysite_2 another (assuming you've defined diferent contents for them)

  • AccessLog: Specifies the full path and name of the file where successful requests will be logged.

  • ErrorLog: Specifies the full path and name of the file where incorrect requests will be logged.

  • GetDir: Enables or disables directory listing in case of absent index file (tipically index). Accepted values: on/off