Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Yaws webserver
Erlang Shell C JavaScript HTML Makefile Other

Use binary:compile_pattern for multipart messages

Remove the (elegant) bm_start and bm_find in favor of
binary:compile_pattern and binary_match to find multipart
boundaries. My simple measurements shows that this improves
performance about 33 times for multipart boundary searching.
latest commit 866ce0d847
@kristofferkoch kristofferkoch authored vinoski committed
Failed to load latest commit information.
applications Set file encoding for wiki application
c_src add check for have_sendfile
contrib Use binary:compile_pattern for multipart messages
doc Documentation changes
ebin Massive autotools refactoring & cleanup
examples Add yaws_api:websocket_close/1,2
include Support the SSL server option client_renegotiation
m4 Massive autotools refactoring & cleanup
man Fix #239: return 400 for missing Host header
munin README.munin
priv Massive autotools refactoring & cleanup
rebar-templates Add yaws as a dep in node rebar.config template
rel Exclude hipe application in reltool.config
scripts New ssl option for yaws.conf: dhfile
src Use binary:compile_pattern for multipart messages
ssl New ssl option for yaws.conf: dhfile
test Fix #239: return 400 for missing Host header
win32 Massive autotools refactoring & cleanup
www Rewrote the news generator on yaws landing page
.gitignore Ignore emacs backup files in .gitignore
.travis.yml Add Erlang/OTP 18.1 support in .travis.yml
ChangeLog whitespace cleanup
LICENSE whitespace cleanup New ssl option for yaws.conf: dhfile
README.cygwin Massive autotools refactoring & cleanup Fix link of the travis status image in
README.osx Add README.osx for instructions on installing on OSX using Homebrew
README.pkg-config whitespace cleanup
_build.cfg Adding files for Erlware. A very rough packaging of 1.76 has been rel… Fix #239: return 400 for missing Host header Massive autotools refactoring & cleanup Support the SSL server option client_renegotiation
known_dialyzer_warnings Retrieve debug env variable before creating the global config record
rebar.config Update rebar.config to require Erlang/OTP R14B02 or higher to compile…
rebar.config.script Support the SSL server option client_renegotiation
two-mode-mode.el updates to make two-mode-mode work with emacs 23 Yaws 2.0 release work add pkg-config support contributed by Olivier Girondel

This is Yaws, a webserver for dynamic content written in Erlang.

Travis build Status

Prepare build

Get and install an Erlang system (

To compile Yaws, Erlang/OTP R14B02 or higher is required.

For SSL-enabled instances, Erlang/OTP R16B01 or higher is required in order to allow only specific protocol versions.

If you've cloned the source from github and you want to build using autotools, note there is no ./configure script in the source, so create one:

$> autoreconf -fi

Install build dependencies. Required packages to compile Yaws are (based on debian packages):

  • build-essential
  • autoconf/automake/libtool
  • erlang - Required apps:
    • erlang-{kernel/stdlib/sasl/erts}
    • erlang-compiler
    • erlang-crypto
    • erlang-xmerl
  • libpam0g-dev

To build the documentation (optional), you also need to install:

  • texlive-latex-base
  • texlive-latex-recommended
  • texlive-fonts-recommended
  • texlive-font-utils
  • texlive-extra-utils
  • ghostscript

On Ubuntu/debian this is pretty much equal to:

$> apt-get build-dep yaws

Finally, to run the testsuites, yaws need to install:

  • git
  • wget
  • curl
  • erlang-eunit
  • erlang-inets
  • erlang-mnesia
  • erlang-ssl
  • cadaver


You can build using rebar:

$> rebar get-deps compile

or via autotools:

$> ./configure --prefix=/usr/local

If using rebar, you'll get a "local installation" with Yaws script in ./bin and the Yaws configuration file in ./etc/yaws.

If using autotools, the build will be configured by default for installation under /usr/local. For more information about installation directories and other supported options, see the configure help. Useful options are:

--with-defaultcharset=CHARSET specify default charset, i.e UTF-8
--with-extrainclude=DIR       dir to include if e.g. pam is installed in some odd place
--with-erlang=PREFIX          prefix where Erlang is installed (optional)

Note to packagers (rpm, deb ...) All install targets support the DESTDIR variable. Thus, if we do

$> ./configure --prefix=/usr; make

we can subsequently do:

$> make install DESTDIR=/foo/bar

All Yaws files will be installed under DESTDIR, but all code will assume Yaws should be installed under /usr.

Main make targets:

  • all : compile Yaws
  • debug : compile Yaws with debug flags
  • clean : remove files produced by all or debug target
  • install : do a proper install of Yaws
  • doc or docs : build the documentation
  • check or test : launch tests
  • cleantest : remove files produced by check target
  • dialyzer : run dialyzer on Yaws
  • mkinstaller : build an installer for windows
  • cleaninstaller: remove files produced by mkinstaller target
  • apps : compile Yaws applications (chat,mail,wiki,yapp)
  • cleanapps : remove files produced by apps target
  • installapps : install Yaws applications
  • fullinstall : install + installapps
  • fullclean : clean + cleantest + cleanapps + cleaninstaller

Test your build

With autotools, to test the build, you should install it somewhere:

$> ./configure --prefix=$PWD/_inst && make install
$> $PWD/_inst/bin/yaws -i

If you used rebar to compile Yaws, you can alternatively start Yaws with

$> ./bin/yaws -i

Either approach will start a webserver at Terminate through ^C, or ^G followed by q, or

> init:stop()

NOTE: If you've used rebar to build the system, none of the following directions apply. With rebar only "local installations" are supported.

Install and run

NOTE: following commands may require root privileges, depending of the installation prefix.

Just run:

$> make install

Then, to run Yaws, you should use its script:

$> ${bindir}/yaws -i

This starts an interactive system.

With the default yaws.conf file, this will create a webserver at http://${host} and one at https://${host}.

You can adapt Yaws configuration by editing '${sysconfig}/yaws/yaws.conf'.

Daemonize Yaws

Start it using '--daemon' and '--heart' options:

$> ${bindir}/yaws --daemon --heart

This will start a daemon (--daemon) which will be autorestarted when/if it crashes or hangs (--heart). Also, for most unices, we create proper start scripts in ${sysconfdir}/init.d

Example: Here is how I compile/start the yaws system that runs at (Ubuntu server system)

$> autoreconf -fi
$> ./configure --sysconfdir=/etc
$> make && make install
$> /etc/init.d/yaws start
Something went wrong with that request. Please try again.