Skip to content
This repository

Jul 25, 2012

  1. Christopher Faulet

    Make the mime types mappings configurable

    Now, it possible to customize the global mime types mappings and to overload
    it for each virtual server. It can be done using following directives in the
    global part or the server part of the configuration:
    * default_type: Defines the default mime type to be used where Yaws cannot
      determine it by its mime types mappings (default: text/plain).
      In the server part, this directive overloads the global one.
    * default_charset: Defines the default charset to be added when a response
      content-type is text/* (default: none). In the server part, this directive
      overloads the global one.
    * mime_types_file: Overrides the default mime.types file included with Yaws
      (default: ${PREFIX}/lib/yaws/priv/mime.types). In the server part, this
      directive overloads the global one but mappings defined in this file will
      not overload those defined by add_types directives in the global part.
    * add_types: Specifies one or more mappings between mime types and file
      extensions. More than one extension can be assigned to a mime type. If a
      mapping is defined in the global part and redefined in a server part using
      this directive, then the later is used. Else the global one is kept.
    * add_charsets: Specifies one or more mappings between charsets and file
      extensions. More than one extension can be assigned to a charset. If a
      mapping is defined in the global part and redefined in a server part using
      this directive, then the later is used. Else the global one is kept.
    Here is an example:
      default_type = text/html
      <server localhost>
          port = 8000
          listen =
          docroot = /var/www
          # nothing is overloaded in the vhost
      <server localhost>
          port = 8001
          listen =
          docroot = /var/www
          # overload global configuration:
          default_type    = text/plain
          mime_types_file = /etc/mime.types
          add_types       = <text/xhtml, yaws> <application/x-test, tst test>
          default_charset = UTF-8
          add_charsets    = <ISO-8859-1, php html yaws> <US-ASCII, tst>
    During Yaws compilation, a default module 'mime_types' is created using the
    default mime.types file. Then, when yaws starts up, this module is
    re-generated, re-compiled and loaded dynamically. The new module replaces the
    default one but the .beam file is unchanged. So if one of these steps failed,
    we fall back on the default module.
    capflam authored capflam committed

Jul 11, 2012

  1. Christopher Faulet

    Add index_files directive into the server part configuration

    This directive sets the list of resources to look for, when a directory is
    requested by the client. If the last entry begins with a "/", and none of
    the earlier resources are found, Yaws will perform a redirect to this uri.
    Default is:
      index_files = index.yaws index.html index.php
    capflam authored

Jun 21, 2012

  1. Steve Vinoski

    add reverse proxy intercept module capability

    Users can now specify an interception module that can rewrite requests and
    responses as they pass through the Yaws reverse proxy. See the
    documentation for details (yaws.conf.5 man page or the yaws.pdf file).
    Also add new set_header, get_header, and delete_header functions to the
    yaws_api module to allow intercept modules and arg rewriters to more easily
    examine and modify #headers{} records.
    Add new tests for the new header manipulation functions and for the reverse
    proxy interception feature.
    vinoski authored

May 11, 2012

  1. Christopher Faulet

    Add support for precompressed static files

    By setting use_gzip_static to true in deflate options, in a vhost
    configuration, It is possible to serve precompressed versions of
    static files. Yaws will look for precompressed files in the same
    location as original files that end in ".gz".
    Only files that do not fit in the cache are concerned and the mtime
    of a precompressed file must be higher than the one of original file.
    capflam authored
  2. Christopher Faulet

    Improve how the responses compression is handled

    Among other things, we can now disable the compression in yaws scripts by
    returning '{header, {content_encoding, "identity"}}'.
    A bug was also fixed when part of a large file is requested. The response
    content length was calculated using the file size and not the part size.
    capflam authored

May 03, 2012

  1. Christopher Faulet

    Make the parameter "x_forwarded_for_log_proxy_whitelist" obsolete

    This parameter is now ignored and throws a warning when yaws starts.
    If necessary, it can be replaced by a simple logger_mod on top of
    yaws_log. To explain how to write such module, an example was added
    into the www directory (www/logger_mod.yaws).
    capflam authored

Apr 25, 2012

  1. Christopher Faulet

    Add options to configure deflate compression behaviour

    By adding "<deflate> ... </deflate>" structure in vhosts configuration,
    it is possible to configure how deflate compression will be applied
    and when it will come into effect. Now we can:
     * define the smallest response size that will be compressed
     * define the compression level to be used
     * specify the zlib compression window size
     * specify how much memory should be allocated for the internal
       compression state
     * choose the strategy used to tune the compression algorithm
    All these parameters are used when a zlib stream is initialized for
    It is also possible to define all compressible mime types.
    Here is an example:
    <server localhost>
      deflate = true
        min_compress_size = 4096
        compression_level = best_compression
        mime_types        = defaults, image/*
        mime_types        = application/xml, application/xhtml+xml, application/rss+xml
        mem_level         = 9
        strategy          = default
        window_size       = 15
    capflam authored
  2. Christopher Faulet

    cosmetic comment and whitespace cleanup in yaws.hrl

    capflam authored

Feb 02, 2012

  1. Christopher Faulet

    Allow the server signature to be defined per virtual server

    Now, we can use the 'server_signature' directive into the server part
    to overload the global one for specific virtual server.
    capflam authored

Sep 26, 2011

  1. Steve Vinoski

    add config setting for acceptor pool size

    Add new config setting to allow the size of the acceptor process pool
    to be set to something other than the default. The default size is the
    same as what it was prior to this change. Also add documentation for
    the new setting, and augment the yaws.conf.template with information
    about it.
    vinoski authored

May 24, 2011

  1. Christopher Faulet

    add shaper directive to control access (capflam)

    inspired by the mod_bwshare module of Apache, add the shaper directive
    to control access to virtual servers. Access can be controlled based
    on the client's IP address. It is also possible to throttle HTTP
    requests based on the client's download rate. External modules used to
    shape the traffic must implement the new behaviour yaws_shaper.
    capflam authored vinoski committed
  2. Christopher Faulet

    support external handler to interpret php scripts (capflam)

    phpfcgi is now deprecated. Instead, you must use php_handler. This
    directive is used to customize the handler to interpret .php files. It
    can be one of the following definitions:
      - php_handler = <cgi, Filename>
      - php_handler = <fcgi, Host:Port>
      - php_handler = <extern, Module:Function | Node:Module:Function>
    If there is no php_handler or deprecated phpfcgi directive, we use the
    value of php_exe_path. Its default value is "/usr/bin/php-cgi" but it
    can be customized.
    capflam authored vinoski committed
  3. Christopher Faulet

    allow multiple listen directives per server (capflam)

    Sometimes, a virtual server must be bound to several IP
    addresses. Previously you had to duplicate virtual server
    configuration and change the address to listen on.
    Now, multiple Listen directives are allowed without any
    duplication. For example, if your server must listen on loopback
    address on both IPv4 and IPv6, your server part may be:
      <server >
        port = 80
        listen =
        listen = ::1
    capflam authored vinoski committed
  4. Christopher Faulet

    server-specific logger_mod and auth_mod (capflam)

    Make logger_mod and auth_mod configuration variables local to each
    virtual server. The logger_mod variable can be used to customize
    access and auth messages. The auth_log variable previously was global,
    but it now lives in the server configuration and the global variable
    is deprecated.
    The new behaviour yaws_logger must be used to define external modules
    to log messages.
    capflam authored vinoski committed

May 23, 2011

  1. Christopher Faulet

    add control for "Expires" and "Cache-Control" response headers (capflam)

    Allow an expires list in the server configuration and add "Expires"
    and "Cache-Control" headers in responses if the mime type of the
    document matches an element of this list. Like the Apache mod_expires
    module, the "expires" configuration directive controls the setting of
    the Expires HTTP header and the max-age directive of the Cache-Control
    HTTP header in server responses. The expiration date can be relative
    to either the time the source file was last modified or to the time of
    the client access. It is possible to have multiple expires directives
    for a virtual server.
    Here is an example:
      <server >
        expires = <image/gif, access+2592000> <image/png, access+2592000>
        expires = <image/jpeg, access+2592000> <text/css, access+2592000>
        expires = <application/javascript, modify+2592000>
    capflam authored vinoski committed
  2. Christopher Faulet

    authorization improvements (capflam)

    There are two changes here. The first improves the implementation of
    authentication mechanisms, like authentication inside all docroots and
    recursion through subdirectories (if you define an authentication
    policy for a directory, then it is automatically applied to any
    subdirectories, except those with their own authentication policy). It
    also adds the docroot directive in auth structures (or .yaws_auth
    files) to restrict it to a specific docroot (no docroot configured
    means all docroots). We can now also configure authentication for
    specific files instead of just directories.
    The second one adds ACLs (Access Control List), like Apache's
    mod_access module, to protect data. You can add directives in auth
    structures (or .yaws_auth files) to control access to particular parts
    of the server based on the client IP address. The allow and deny
    directives are used to specify which clients are or are not allowed to
    access to the server, while the order directive sets the default
    access state and configures how the allow and deny directives interact
    with each other. Use "/" as default directory in auth structure;
    yaws.conf manpage has been updated accordingly.
    Here is an example:
      <server >
          docroot = /var/www/yakaz/admin
          deny    = all
          allow   =,
          order   = deny,allow
    capflam authored vinoski committed

Apr 20, 2011

  1. Steve Vinoski

    major trailing whitespace cleanup

    Remove trailing whitespace in all .erl and .hrl files in the
    If you're an emacs user, you can easily see trailing whitespace using
    settings like these in your ~/.emacs file:
    (setq-default show-trailing-whitespace t)
    (set-face-background 'trailing-whitespace "slate gray")
    You can also delete trailing whitespace automatically when you save
    your Erlang sources by setting the emacs before-save-hook in your
    ~/.emacs file like this:
    (add-hook 'before-save-hook
              '(lambda () (if (eq major-mode 'erlang-mode)
    vinoski authored

Apr 03, 2011

  1. Steve Vinoski

    add configurable access logging

    Add the global logger_mod config variable to allow for customized
    access logging. Document logger_mod in yaws.conf.5 and yaws.tex.
    vinoski authored

Mar 05, 2011

  1. Claes Wikstrom

    Some dialyzer fixes - no real bugs, just enhancements, removed the de…

    …precated feature of fdsrv, and fixed some bugs recently introduced by Tobbe and yaws_session_server

Jan 06, 2011

  1. Nicolas Thauvin

    Added a comment in yaws.hrl

    nthauvin authored
  2. Nicolas Thauvin

    Pluggable ysession storage with mnesia sample in src/contrib, part 2

    nthauvin authored

Oct 21, 2010

  1. Fabian Linzberger

    add implementation of X-Forwarded-For header (Fabian Linzberger)

    * Add x_forwarded_for_log_proxy_whitelist global config parameter and
      parsing for it.
    * Add x_forwarded_for header in record definition and collection
      (based on code by Chris Double he mentions on
    * For yaws_server:maybe_access_log/3: if originating IP is present in
      x_forwarded_for_log_proxy_whitelist, log last IP found in
      x-forwarded-for header instead of originating IP
    lefant authored vinoski committed

Oct 01, 2010

  1. avtobiff

    Fixed and updated SSL verify options.

    * Fixed documentation for verify values to correspond to Erlang's SSL
    * Updated documentation to include new SSL implementation options.
    * Updated #ssl{} and yaws:ssl_listen_opts/2 to include
    avtobiff authored

Aug 23, 2010

  1. Steve Vinoski

    Add auth_skip_docroot server config variable (Christian Hennig)

    At startup Yaws normally searches the entire docroot for .yaws_auth
    files. For very large docroot directories, the time required to
    perform the search can result in unacceptably long startup times. To
    allow for large docroot directories, add auth_skip_docroot server
    config variable which, if set to true, prevents Yaws from searching
    the docroot for .yaws_auth files. The variable defaults to false.
    Add documentation for auth_skip_docroot variable.
    Also clean up some whitespace and typos in the yaws.conf.5 man page.
    vinoski authored

Jul 21, 2010

  1. Steve Vinoski

    add support for PHP FCGI applications (Hans-Christian Esperer)

    Add server configuration support for PHP FCGI applications. Modify
    dispatching support to invoke a PHP FCGI server for .php files if
    Modify existing FCGI application server configuration to use a single
    separate fields. Use the same approach for the phpfcgi field. Patch up
    yaws_cgi.erl for these changes.
    Enhance yaws.conf.5 and yaws.tex to describe the new PHP FCGI
    Also fix a number of editorial issues in yaws.tex.
    vinoski authored

May 10, 2010

  1. Steve Vinoski

    Use gconf keepalive_timeout for connection lifetime (Brady McCary)

    Previously persistent connections were held open for a hard-coded 30
    seconds, and if no request was received in that time, Yaws closed the
    connection. Change this behavior to use the gconf keepalive_timeout
    field to determine the amount of time the connection is held open
    rather than using a hard-coded timeout. The default is still 30
    seconds, but users can change the default by specifying a different
    value for keepalive_timeout in their Yaws configuration.
    Also, fix yaws.tex to document the keepalive_timeout setting as well
    as other recent changes such as max_connections and keepalive_maxuses.
    vinoski authored

Apr 14, 2010

  1. Added a new configuration parameter called "keepalive_maxuses" which …

    the yaws admin to close persistant connections after X number of uses. This
    is handy for some types of system which may generate a lot of garbage in the
    process in the erlang VM or for other reasons where you want to limit how
    many requests can be processed on a single connection. The default setting
    remains unlimited.
    Thomas O'Dowd authored

Apr 07, 2010

  1. Added a new configuration parameter to allow the administrator to con…

    the erlang virtual machines garbage collection knobs when spawning a new
    process to handle incoming connections. The option is called "process_options".
    Its default value is the empty list which uses erlangs default options as
    is the case now. This is useful for long lived connections which can generate
    a lot of garbage if left untapped. Use with care :-)
    Thomas O'Dowd authored

Mar 02, 2010

  1. The default value for partial_post_size was nolimit, not a good defau…

    …lt value and also erroneoulsy documented
    Claes Wikstrom authored

Dec 15, 2009

  1. Steve Vinoski

    do not pass the --id option if the default id is used

    The default id in the code is represented as the string "default". If
    the --id option passes default to set the id, it becomes the atom
    default which of course differs from the string "default". By not
    using --id to specify the default id, we get the value "default" as
    the default.
    Make sure ids passed in via the --id option that yaws_sup.erl sees as
    atoms are converted to lists. This matches what's done for other
    options involving ids such as --check and --stop.
    Other changes in this commit make sure that the $HOME/.yaws/yaws/ID
    path is used consistently across the code and documentation, and also
    a couple minor whitespace/indentation cleanups.
    vinoski authored

Dec 02, 2009

  1. Claes Wikstrom

    Forward prox functionality added through a patch by Colm Dougan


Nov 29, 2009

  1. Claes Wikstrom

    Added support for excluding dirs from an appmod. This is useful for /…

    … appmods

Nov 23, 2009

  1. Eric Liang

    add the soap_srv_mods support, which can setup soap serve modules whi…

    …le yaws start.
    ericliang authored committed

Aug 17, 2009

  1. Claes Wikstrom

    max number of connections patch by Kinoshita


Jul 10, 2009

  1. Claes Wikstrom

    cgi support

Something went wrong with that request. Please try again.