Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 25, 2012
  1. @capflam

    Make the mime types mappings configurable

    capflam authored capflam committed
    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 = 0.0.0.0
          docroot = /var/www
          # nothing is overloaded in the vhost
      </server>
    
      <server localhost>
          port = 8001
          listen = 0.0.0.0
          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>
      </server>
    
    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.
Commits on Jan 6, 2012
  1. @capflam

    Add new module to deal with trace files

    capflam authored
    This module is a replacement of what we find in yaws_log.erl. This is the
    first step to improve traces handling.
    
    Changes with yaws_log.erl:
    
      * Trace files are created in a subdirectory suffixed with the creation
        date. So this subdirectory changed every time yaws restarts.
    
      * There is 1 trace file by connection handler. So traces cannot be
        interwined with each other
    
      * We can enable/disable trace for a period of time (must be improved
        to be fully dynamic)
Commits on May 24, 2011
  1. @capflam @vinoski

    add shaper directive to control access (capflam)

    capflam authored vinoski committed
    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.
  2. @capflam @vinoski

    server-specific logger_mod and auth_mod (capflam)

    capflam authored vinoski committed
    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.
Commits on May 23, 2011
  1. @capflam @vinoski

    add yaws.appup.src template file (capflam)

    capflam authored vinoski committed
    Add yaws.appup.src template file used to build the final yaws.appup
    file. Also add ebin/yaws.appup to .gitignore.
Something went wrong with that request. Please try again.