= Installing ErlyWeb on Mac OS X = _This is a work in progress. Please don't follow these instructions until this banner is removed._ == STARTING POINT == My starting point is an Intel MacBook (2.16 GHz Intel Core 2 Duo) running Mac OS X 10.5.1 and I have the Developer Tools installed. All of my browser downloads go to a folder on my Desktop called Downloads (1). I build all of my software within the standard directory (2) specified by the File System Hierarchy Standard (3). == DEPENDENCIES == Erlyweb has a couple of external dependencies and these must be downloaded and installed before anything else can be done. The first dependency is Erlang (4). See ... you knew there was a reason that it was called ERLyweb. The second dependency is YAWS (5). Again, there's a reason it's called erlyWEB. == ERLANG == Download the latest source code version of Erlang from the Erlang download page (6). This will give you a gzipped tar file. The latest version at the time of writing is in a file called "otp_src_R12B-0.tar.gz". Untar the file: {{{ $ cd /opt $ tar xvzf ~/Desktop/Downloads/otp_src_R12B-0.tar.gz $ cd otp_src_R12B-0 $ ./configure $ make $ sudo make install }}} To make sure that everything works as planned: {{{ $ which erl /usr/local/bin/erl $ erl -version Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.6 }}} == YAWS == Now you need to install the YAWS webserver. Download the latest source code version from the YAWS download page (7). This will give you a gzipped tar file. The latest version at the time of writing is in a file called "yaws-1.73.tar.gz". Untar the file: {{{ $ cd /opt $ tar xvzf ~/Desktop/Downloads/yaws-1.73.tar.gz $ cd yaws-1.73 $ ./configure $ make $ sudo make install }}} Now make sure that things work: {{{ $ which yaws /usr/local/bin/yaws }}} == ERLYWEB == Now it's time to install the star of the show, the one and only ErlyWeb(8)! The crowd goes wild ... we pause a moment to let the cheers die down! :-) Download the latest source code from the ErlyWeb Google Project page(9). The latest version at the time of writing is "erlyweb-0.7.tar.gz". (I have no idea why the file format changed from zip to tar gzip, but it will not cause us any problems during our install.) Untar the file: {{{ $ cd /opt $ tar xvzf ~/Desktop/Downloads/erlyweb-0.7.tar.gz }}} Next, figure out where your OTPROOT is. The OTPROOT is where the Erlang code server (the piece of Erlang that finds and loads BEAM files) looks for code. (A close but imperfect analogy for those with a Java background, would be a form of automatic CLASSPATH.) If you don't know what the value of OTPROOT for your operating system is, start up the Erlang interactive shell and type: {{{ 1> code:root_dir(). "/usr/local/lib/erlang" 2> q(). ok }}} Your OTPROOT is the lib directory below the value returned by code:root_dir(). On my Mac, this turns out to be "/usr/local/lib/erlang/lib". The reason that we care deeply about the OTPROOT directory is that we need a place to store the ErlyWeb BEAM files that the system will automatically find. Creating a directory with a name and a version suffix that itself also contains a directory called ebin, will cause it to be added to the automatic code search path. This is exactly what we need, so let's take advantage of this fact. {{{ $ cd /usr/local/lib/erlang/lib $ sudo mkdir erlyweb-0.7.0 $ cd erlyweb-0.7.0 $ sudo mkdir ebin $ cd ebin $ sudo cp /opt/erlyweb-0.7/ebin/*.beam . }}} With ErlyWeb now installed in a location that our Erlang environment can automatically find it, we try out ErlyWeb for the first time. _... more content goes here! ..._ == REFERENCES == A list of the links necessary to follow this Howto: # ~/Desktop/Downloads # /opt # http://pathname.com/fhs/ # http://erlang.org/ # http://yaws.hyber.org/ # http://erlang.org/download.html # http://yaws.hyber.org/download/ # http://erlyweb.org/ # http://erlyweb.googlecode.com/