Content area
Full text
The Functional Web
Yaws: Yet Another Web Server
Steve Vinoski Verivue
The modestly named Yaws Yet Another Web Server is an open source Erlang Web server known for its reliability, stability,
and scalability. It started roughly a decade ago as the brainchild of legendary Erlang programmer Claes Klacke Wikstrm, who also invented several important Erlang features, including Erlang term storage (ets), Distributed Erlang, the Mnesia database, and the Erlang bit syntax. Yaws is a general-purpose HTTP 1.1 Web server consisting of a relatively simple core surrounded by implementations of various features, such as response streaming, AJAX support, websockets support, Common Gateway Interface (CGI) and Fast CGI (FCGI) support, and application embedding. While its perfectly capable of performing regular le serving, Yaws is most useful for applications that generate and serve dynamic content.
Congure, Make, Install
To get started with Yaws, you can either obtain an ofcial release from its primary website, http://yaws.hyber.org, or you can retrieve the latest sources from the Yaws github.com source repository:
git clone git://github.com/klacke/yaws.git
You can build Yaws in two different ways: either using GNU autotools and make, or via the rebar Erlang build tool (see https://github.com/ basho/rebar). To use the autotools approach:
autoconf./configuremake & sudo make install
This will build Yaws and by default install it into /usr/local/bin/yaws, with Erlang beam
bytecode les and other parts of the Yaws system installed elsewhere under /usr/local. Command-line options for the generated congure script let you choose alternative installation locations. This approach is suitable for running Yaws as a stand-alone Web server. Alternatively, you can build Yaws using rebar:
rebar compile
The result of this approach, which builds Yaws and installs it within its own build area, can also run stand-alone but is best-suited for applications that embed Yaws as an internal Web server.
Runtime Conguration
Yaws conguration controls details such as where it looks for les being served, what ports it listens on, and what applications it loads to handle requests. Two conguration portions exist. Server congurations apply to individual virtual servers. A single Yaws instance can host multiple virtual servers on the same or different IP addresses. Server conguration controls features such as on which port and IP address the server listens for requests, the root path in the lesystem...





