Difference between revisions of "Installing yaws by source"

From Notes_Wiki
(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 ...")
 
m
Line 4: Line 4:


Installation of yaws can be done using:
Installation of yaws can be done using:
#<tt>yum -y install pam-devel</tt>
#Download latest source code
#Download latest source code
#Extract source file
#Extract source file using something similar to '<tt>tar xzf yaws-&lt;version&gt;.tar.gz</tt>'.
#<tt>./configure; make; sudo make install</tt>
#<tt>./configure; make; sudo make install</tt>



Revision as of 08:40, 4 August 2016

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. yum -y install pam-devel
  2. Download latest source code
  3. Extract source file using something similar to 'tar xzf yaws-<version>.tar.gz'.
  4. ./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>