How to run httpd as daemon?

Matthias Lang <>
Wed Jul 24 14:15:38 CEST 2002


If you search for

  "Erlang daemon" 

on google, the first page that google finds is a step-by-step
description of how to run erlang programs as daemons:

   http://www.bluetail.com/wiki/showOldPage?node=ErlangDaemons&index=1

Alternatively, the 'erl' manpage describes how to use the '-detached'
flag to start the system as a daemon:

   http://www.erlang.org/doc/r8b/erts-5.1.1/doc/html/erl.html

The FAQ also gives an example of how to run things from the command
line, though the author was too lazy or clueless to include an example
using -detached:

   http://www.erlang.org/faq/x304.html#AEN329

It says that you need to create (and compile!) a program something like:

	-module(hello).
	-export([hello_world/0]).
	
	hello_world() -> 
		      httpd:start_link("my_http_config_file.conf"),
		      receive 
			      nothing -> ok
		      end.

and then run it using a command line something like:

   erl -detached -s hello hello_world

Matthias




More information about the erlang-questions mailing list