Build and install

Yaws is hosted by the excellent source code site SourceForge SourceForge.net Logo The Yaws SourceForge www page is http://sourceforge.net/projects/erlyaws

Tested releases are downloadable from the yaws website download directory, use a regular release unless you plan to hack yaws. Regular releases are found at http://yaws.hyber.org/download

To check out the latest source first install an Erlang system, then follow the instructions at the yaws/sourceforge svn page

To build and to what is knows as a local install, e.g. a developer install or a regular install

# cd erlyaws/trunk/yaws; ./configure; make; make install

The above commands will checkout the bleeding edge source, build it and install it at 127.0.0.1:80 with the docroot set to the local documentation.

make (without install) will build the yaws system and make local_install does a local install at http://127.0.0.1:8000. This is the typical mode of operation while either just trying out yaws, or hacking yaws. This will install a template configuration file yaws.conf in $HOME. If $HOME/yaws.conf exists, the old file will not be overwritten.

A yaws executable (shell script) will be written into the $HOME/bin directory.

To run a locally installed system, we run the yaws script found in the bin directory in the source code tree or $HOME/bin/yaws

make install will also build the yaws system and also install it in /usr/local. A configuration file /etc/yaws.conf will also be installed unless the file already exists. The default config file will set up the system to listen on http://127.0.0.1:80

Running yaws

The yaws executable is a shell script which invokes the erlang system and instructs it to start yaws. The command line flags for yaws are documented in man page for yaws (1)

When developing yaws code, the interactive mode is ideal. Typically yaws is then started as:



yaws -i

Run yaws as a daemon as

yaws --daemon

All command line flags to yaws are described in the man page for yaws.

Configuring Yaws

Web server configuration can be supplied to yaws in either of two ways depending on whether we run yaws as a standalone daemon or if we run yaws as an embedded application inside another Erlang program.

The yaws configuration is described in man page for yaws.conf (5)

Embedded mode

It is possible to run yaws in embedded mode where yaws is part of a larger application. When running yaws in embedded mode, it is often not possible to let yaws read its configuration data from /etc/yaws.conf.

The function yaws_api:setconf(Gconf, Groups)can be used by an other erlang process to explicitly set a yaws configuration at runtime. To execute Yaws in embedded mode, it must be started with the environment {embedded, true} The embedded mode is fully described at embed.yaws

Valid XHTML 1.0!