summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-03-21 10:20:45 +0100
committerLinus Nordberg <linus@nordberg.se>2014-03-21 10:20:45 +0100
commit37e2c08b223d62e074c06d6214ac36443166bdaf (patch)
tree092afd32541ec4b1e3743a0aa4bb457157682a78
parentfe30da9f73a30c1039b70bbf34df50dc4e29171d (diff)
Add dynamic config to httpd server.
-rw-r--r--src/tools/httpd_inets.erl8
-rw-r--r--src/tools/httpd_inets_props.conf10
2 files changed, 17 insertions, 1 deletions
diff --git a/src/tools/httpd_inets.erl b/src/tools/httpd_inets.erl
new file mode 100644
index 0000000..161d0f5
--- /dev/null
+++ b/src/tools/httpd_inets.erl
@@ -0,0 +1,8 @@
+-module('httpd_inets').
+-export([hello/3]).
+
+hello(SessionID, _Env, _Input) ->
+ mod_esi:deliver(SessionID, [
+ "Content-Type: text/html\r\n\r\n",
+ "<html><body>hello, erlang world</body></html>"
+ ]).
diff --git a/src/tools/httpd_inets_props.conf b/src/tools/httpd_inets_props.conf
index a4b57c6..c94fed9 100644
--- a/src/tools/httpd_inets_props.conf
+++ b/src/tools/httpd_inets_props.conf
@@ -7,5 +7,13 @@
{socket_type, essl},
{ssl_certificate_file, "/tmp/httpd_inets/02.pem"},
{ssl_certificate_key_file, "/tmp/httpd_inets/srv1.key"},
- {ssl_ca_certificate_file, "/tmp/httpd_inets/01.pem"}
+ {ssl_ca_certificate_file, "/tmp/httpd_inets/01.pem"},
+ {modules, [mod_alias,
+ mod_auth,
+ mod_esi,
+ mod_get,
+ mod_head,
+ mod_log,
+ mod_disk_log]},
+ {erl_script_alias, {"/d", [httpd_inets]}}
].