Skip to main content
Version: master

yaws

info

Recommended PREFERRED_VERSION for yaws:

yawsErlang/OTPElixir
2.1.125.3%-

In this guide we are using the plain meta-erlang layer to build an httpd webserver called Yaws.

The recipe yaws_2.0.7.bb builds the Yaws using a crosscompile approach both to erlang and C. Yaws uses the autoconf build environment making the whole process straightforward when creating the recipe.

As a final result, we are able to run a standalone Yams using qemu. In fact, Yaws recipe is only useful when working with standalone mode (see Yaws website). Yaws also supports an embedded mode but usually that should be integrate with an high order application.

Follow the quickstart guide to get a basic working environment and then:

  • Add yaws package to IMAGE_INSTAL in conf/local.conf
echo 'IMAGE_INSTALL:append = " yaws"' >> conf/local.conf
  • There is a package called yaws-examples that adds code and examples. This is an optional step
echo 'IMAGE_INSTALL:append = " yaws yaws-examples"' >> conf/local.conf
  • Now it's time to build the image:
bitbake core-image-minimal
  • And check the results with qemu:
runqemu core-image-minimal

To start yaws, there are two options:

  1. Using systemv or systemd script
# systemv
/etc/init.d/yaws
# systemd
systemctl start yaws
  1. Call the yaws help scripts to start the webserver:
/usr/bin/yaws

After that, from your host environment, you can access the webserver reaching one of the two endpoints available:

Yaws, is a webserver totally functional and ready to create great applications. The Yaws website has a lot of high quality information.