Installing Erlang, Yaws and Erlyweb on Mac OS X

This is a short how-to showing how to install Erlang, Yaws and Erlyweb on Mac OS X via MacPorts.

First we need to install Erlang and Yaws and link Yaws under erlang/lib:

$ sudo port install erlang yaws
$ sudo ln -sf /opt/local/lib/yaws /opt/local/lib/erlang/lib/yaws

Then we append erlang/bin to the PATH env variable (you can put this on your ~/.bashrc file):

$ export PATH=/opt/local/lib/erlang/bin:$PATH

And finally we install Erlyweb:

$ git clone git://github.com/dirceu/erlyweb.git
$ cd erlyweb ; make ; sudo make install
$ cd .. ; rm -rf erlyweb

My fork of Erlyweb contains some changes I did today:

  • "make install" creates a create_erlyweb_app.sh under erlang/bin. It's just a link to erlyweb/scripts/create_app.sh and takes two arguments: AppName and AppDir;
  • erlyweb_util:create_app/2 now creates a "log" directory (for Yaws log files) and a ready-to-run yaws.conf file.

With this changes you can create and run a simple application using:

$ mkdir -p ~/apps/myapp
$ create_erlyweb_app.sh myapp ~/apps
$ cd ~/apps/myapp
$ yaws --conf yaws.conf

blog comments powered by Disqus