
cat > conf/monkey.conf <<EOF
# Monkey HTTP Daemon - Configuration
# ==================================
# These are the main variables and their descriptions, defined in respect
# to the configuration of the different types of directives.

[SERVER]
    # Port:
    # -----
    # Port is the number of the door in which Monkey will be listened through
    # connections and petitions. This number can have any value between 1 and
    # 65535. If the specified number is less than or equal to 1024, only root
    # superuser's owned process will be able to be established as a connection.

    Port #PORT#

    # Listen:
    # -------
    # The Listen directive restricts to the network interface from where Monkey
    # will be listening for incoming connections. If you want to restrict to the
    # lookback interface, for IPv4 you can set '127.0.0.1' or the value '::1' in
    # case of IPv6, e.g:
    #
    # Listen 127.0.0.1

    # Workers:
    # --------
    # Monkey launches threads to attend clients; each worker thread is capable
    # of attending more than one client request at one time. The amount of
    # clients that can be handled by each thread is calculated using the
    # number of file descriptors allowed by the system. If this variable
    # is set to 0 monkey will launch one thread per processor.

    Workers 0

    # Timeout:
    # --------
    # The largest span of time, expressed in seconds, during which you should
    # wait to receive the information or waiting time for the remote host to
    # accept an answer. (Timeout > 0)

    Timeout 15

    # PidFile:
    # --------
    # File where the server guards the process number when starting.
    # Note that the filename will have the port number appended to it.

    PidFile #PIDFILE#

    # UserDir:
    # --------
    # Directory name for users home (/~user).

    UserDir public_html

    # Indexfile:
    # ----------
    # Number of the initial file of aperture when calling a directory.

    Indexfile index.html index.htm index.php

    # HideVersion:
    # ------------
    # For security reasons, sometimes people want to hide the version of his
    # own webserver to clients (values on/off).

    HideVersion off


    # Resume:
    # -------
    # Allow clients to request files by ranges (values on/off).

    Resume on

    # User:
    # -----
    # If you want the webserver to run as a process of a defined user, you can
    # define it in this variable. For the change of user to work, it's necessary
    # to execute Monkey with root privileges. If it's started by a user that
    # that doesn't have root privileges, this variable will be omitted.

    User #USER#

    # -----------------
    #  ADVANCED CONFIG
    # -----------------
    # Just change the next variables if you know what are you doing.

    # KeepAlive:
    # ----------
    # Allow persistent connections. (on/off)

    KeepAlive on

    # KeepAliveTimeout
    # ----------------
    # Number of seconds to wait for the next request in a persistent
    # connection (value > 0).

    KeepAliveTimeout 5

    # MaxKeepAliveRequest:
    # --------------------
    # Maximum number of requests per connection. (value > 0)

    MaxKeepAliveRequest 1000

    # MaxRequestSize:
    # ---------------
    # When a request arrives, Monkey allocs a 'chunk' of memory space
    # to receive the incoming data. As many times the incoming data
    # size is undeterminated, Monkey increases the buffer as required. This
    # variable defines the maximum size that the buffer can grow in terms
    # of KB. Example: defining 'MaxRequestSize 32' means 32 Kilobytes.
    # The value defined must be greater than zero. Default value defined
    # is 32.

    MaxRequestSize 32

    # SymLink:
    # --------
    # Allow request to symbolic link files.

    SymLink Off

    # TransportLayer:
    # ---------------
    # Define which network I/O plugin provides the transport layer. The
    # value of the key belongs to the shortname of the plugin. Make sure
    # the plugin is loaded by 'plugins.load' file.
    #
    #    HTTP  is provided by liana
    #    HTTPS is provided by mbedtls

    TransportLayer liana

    # DefaultMimeType:
    # ----------------
    # If a static content is requested and it does not contain a known extension,
    # Monkey will send the mime type specified on this directive.

    DefaultMimeType text/plain

    # FDT:
    # ----
    # The File Descriptor Table (FDT) it's an internal mechanism to share open
    # file descriptors under specific threads and virtual host context. When
    # enabled, it helps to reduce the number of opened file descriptors for the
    # same resource and the number of required system calls to open and close
    # files.
    #
    # The overhead in memory of this feature is around ~5KB per worker.

    FDT On

EOF
