Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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 Apr 1, 2012
  1. @tuncer @vinoski

    Use file:sendfile/5 if available

    tuncer authored vinoski committed
    Due to a bug in file:sendfile/5 in R15B, the yaws configure script enables
    the use of file:sendfile/5 only for versions R15B01 or greater.
Commits on Dec 21, 2011
  1. @vinoski

    make "rebar compile" install under the build dir

    vinoski authored
    A "rebar compile" used to install yaws, yaws.conf, and other files
    under the user's home directory, just like "make local_install". This
    approach isn't idiomatic to rebar usage, so change it to install files
    locally under the build directory. Starting ./bin/yaws from the build
    directory starts this local installation.
Commits on Oct 20, 2011
  1. @vinoski

    make sed commands for version substitution more robust

    vinoski authored
    The sed commands in yaws.app.src and rebar-pre-script were pretty
    picky regarding the presence of empty lines or other garbage in the
    vsn.mk file. Change to make sed operate only on the desired version
    text.
Commits on May 8, 2011
  1. @vinoski

    more build avoidance for rebar build

    vinoski authored
    Modify scripts/rebar-pre-scripts and scripts/local-install to avoid
    rebuilding generated files that haven't changed since the last
    build. Modify scripts/Makefile to account for local-install changes.
    
    Also apply minor fix to rebar.config indentation.
Commits on May 7, 2011
  1. @tuncer @vinoski

    add rebar support (Tuncer Ayaz and Steve Vinoski)

    tuncer authored vinoski committed
    Add support for building yaws with rebar. The original configure and
    make support is kept intact.
    
    If you build with rebar you get a local install. The rebar approach
    does not support a regular install, which defaults into /usr/local. If
    you want a regular install, use configure and make.
    
    Create a new top-level contrib directory and move unused src files
    there. Also move src/benchmarks and src/contrib contents there as
    well. Remove the obsolete src/patches directory. This is all to keep
    rebar from compiling this unused code (since by default it compiles
    everything under the src dir).
    
    Move a number of build rules out of Makefiles into separate scripts so
    they can be used by both rebar and make.
    
    Modify yaws version specifier and handling to be amenable to rebar.
    
    Clean up trailing whitespace in a number of scripts and Makefiles.
    
    Use the following environment variables to customize the rebar build
    defaults:
    
    DEFAULT_CHARSET: used in mime type table (default: "")
    ERLBINDIR: e.g. /usr/local/bin
    ETCDIR: etc directory (default: ./etc)
    VARDIR: var directory (default: ./var)
Something went wrong with that request. Please try again.