public
Description: Nitrogen Web Framework for Erlang
Home | Edit | New

Install Nitrogen on Yaws

DEPRECATED

Now you create a new application using the `nitrogen` command and change ‘inets’ to ‘yaws’ in the ebin/myweb.app file.

For more follow the Installing Nitrogen instructions


Nitrogen hooks into Yaws through an appmod.

1. Download and build Yaws.

  • Download Yaws to a directory called YAWS_ROOT.
  • Under YAWS_ROOT run ‘configure’, then ‘make’.

2. Download Nitrogen and build Nitrogen

  • Download Nitrogen to a directory called NITROGEN_ROOT
  • Under NITROGEN_ROOT run ‘make’.

3. Copy the Nitrogen Web Files

Nitrogen needs the files under NITROGEN_ROOT/www to run. Copy these files to a nitrogen directory under your Yaws docroot:

mkdir YAWS_DOCROOT/nitrogen; cp NITROGEN_ROOT/www/* YAWS_DOCROOT/nitrogen

- or -

ln -s NITROGEN_ROOT/www YAWS_DOCROOT/nitrogen

The goal is to have these files served under http://localhost:8000/nitrogen

4. Set up wf_global

  • Copy NITROGEN_ROOT/QuickstartInets/src/wf_global.erl to your application’s src directory.
  • Edit wf_global.erl, replace the signkey with a unique signkey that only you know. Nitrogen uses this value to uniquely sign data that it sends to the browser.
  • Compile wf_global.erl

7. Add the Nitrogen Appmod.

Add an appmod that catches all requests to “web” and directs them to the wf_yaws module.

appmods = [{"web", wf_yaws}]

Need help with Yaws appmods? See the Yaws documentation

8. Add call to wf:init()

Somewhere in the code that starts your application, add a call to wf:init(). This should only be run once when your application starts.

9. Test

Start up your application and navigate to http://localhost:8000/web
Congratulations, you are now running Nitrogen.

Last edited by JonGretar, Tue Jan 20 07:26:27 -0800 2009
Home | Edit | New
Versions: