Installing Yaws on Windows

I wanted to try out YAWS– a webserver written in Erlang, and see if it works fine on Windows XP.

There is some decent amount of content on how to install YAWS on Windows. See here, here, and a discussion that I kicked off. In any case, I wanted to ensure that I capture my experience with installing this correctly.

I have copied content from here, and modified it to illustrate what worked for me:

  1. Install Cygwin
  2. Install Erlang
  3. Set the Erlang <Erlang_home>\bin path to the system path. This will ensure that the erl.exe, and erlc.exe are accessible from any directory.
  4. Download Yaws. Scroll to the bottom of this page, and download the latest build – yaw-x.yy will be the pattern of that file.
  5. Unpack the downloaded file to a local directory. For instance, c:\opensource\yaws-x.yy. If you unpack the downloaded file under Cygwin, it will create a symbolic link – “yaws” – pointing to yaws-x.yy. Remove this symbolic link.
  6. Rename the yaws-x.yy directory to yaws
  7. Start Cygwin, and change directory to the yaws install directory – in our case c:\opensource\yaws-x.yy. Notice that you have to type cd /cygdrive/c/opensource/yaws-x.yy to change directory.
  8. Type ./configure --prefix= --localstatedir=/var --sysconfdir=/etc
  9. Type make
  10. Type make local_install
  11. Edit the configuration file – yaws.conf. This is present in the user’s home directory. In my case, it is present in /home/skiran/yaws.conf. Change all ocurrences of /cygdrive/c to c: (or the unit letter where yaws is installed).
  12. Remove from yaws.conf the https part unless you have ssl installed on windows. I commented out this section:
    # And then an ssl server# <server skiran>
    # port = 4443
    # …
    # </server>
  13. Try to run yaws from within Cygwin, using the command:
    1. bin/yaws -i to start an interactive session on cygwin
    2. bin/yaws -D to start yaws as a daemon
    3. bin/yaws -w to start yaws in werl
  14. The option that worked for me was to run yaws from within the Windows command prompt. The command structure is erl -pa <path_to_yaws_ebin_folder> -yaws debug -run yaws --conf <path_to_yaws_config_file> -yaws id default
    In my case, the path_to_yaws_ebin_folder is c:\opensource\yaws\ebin, and the path_to_yaws_config_file is c:\opensource\cygwin\home\skiran
  15. I opened a command prompt to the folder that contains the yaws.config file – c:\opensource\cygwin\home\skiran – and typed the command erl -pa c:\opensource\yaws\ebin -yaws debug -run yaws --conf ./yaws.config -yaws id default
  16. Yaws should start correctly, with a message “Yaws: Listening to…
  17. Open a browser window to the url that it mentions, and you should be all set.

3 thoughts on “Installing Yaws on Windows”

  1. Hi,

    This blog is supposed to be about installing Yaws in Windows but the explanation is referring unix directories.

    ./configure –prefix= –localstatedir=/var –sysconfdir=/etc

    I still would like to know the steps on how to install Yaws in Wnodows.


    1. Mohamed,
      This entry is about my experience with installing Yaws in Windows, except you need to install it within Cygwin on Windows. Cygwin is the reason the directories follow the Unix directory structure.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s