Inets is a container for Internet clients and servers. Currently, an HTTP server and an FTP client has been incorporated in Inets. The HTTP server is an efficient implementation of HTTP 1.0 as defined in RFC 1945, namely a Web server.
It is possible to start a number of Web servers in an
embedded system using the services
config parameter from
an application config file. A minimal application config file
(from now on referred to as inets.conf
) starting two HTTP
servers typically looks as follows:
[{inets, [{services,[{httpd,"/var/tmp/server_root/conf/8888.conf"}, {httpd,"/var/tmp/server_root/conf/8080.conf"}]}]}].
A server config file is specified for each HTTP server to be started. The config file syntax and semantics is described in httpd(3).
inets.conf
can be tested by copying the example server
root to a specific installation directory, as described in
httpd(3). The example below
shows a manual start of an Erlang node, using inets.conf
,
and the start of two HTTP servers listening listen on ports 8888
and 8080.
$ erl -config ./inets Erlang (BEAM) emulator version 4.9 Eshell V4.9 (abort with ^G) 1> application:start(inets) {ok,<0.24.0>}