Installing yaws by source

From Notes_Wiki
Revision as of 06:15, 10 November 2012 by Saurabh (talk | contribs) (Created page with "=Installing yaws by source= We can install latest version of yaws using source downloaded from http://yaws.hyber.org/ When installing yaws using source, it is possible that ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Installing yaws by source

We can install latest version of yaws using source downloaded from http://yaws.hyber.org/ When installing yaws using source, it is possible that latest version of yaws depends upon library functions available only in latest versions of erlang. Hence before yaws is installed from source it is recommended that first latest erlang from source and then install yaws.

Installation of yaws can be done using:

  1. Download latest source code
  2. Extract source file
  3. ./configure; make; sudo make install


Testing yaws

Create a yaws.conf file with following lines:

logdir = <path_for_log_folder>
ebin_dir = /usr/local/lib/yaws/ebin
include_dir = /usr/local/lib/yaws/include
# and then a set of servers
<server localhost>
        port = 8888
        listen = 127.0.0.1
        docroot = <path_for_doc_root>
</server>

and start yaws with 'yaws -i' command from folder where yaws.conf file is present.

Sample dynamic page

Following sample dynamic page can be used to test whether yaws is able to serve dymaic pages properly or not:

<html>
<p> First paragraph
<erl>
out(Arg) ->
{html, "<p>This string gets inserted into HTML document dynamically"}.
</erl>
<p> And here is some more HTML code
</html>