diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-03-21 11:44:05 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-03-21 11:44:05 +0100 |
commit | d883acf9749bb2f304570b74509d8399bd91604b (patch) | |
tree | 3c96bb963340444bd491e4d3404d01a9bbce357f | |
parent | 526b0a331cd957f8785031d92a386272ab9735b2 (diff) |
Add info about mod_esi.
-rw-r--r-- | src/tools/README | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/tools/README b/src/tools/README index b59a277..3db5c00 100644 --- a/src/tools/README +++ b/src/tools/README @@ -1,5 +1,5 @@ -* httpd with ssl - +* httpd +** ssl Run httpd using inets. Tell inets what to start by configuring 'services' in a config file that you pass to erl(1) at startup: @@ -51,3 +51,35 @@ SSLCertificateFile /tmp/httpd_inets/02.pem SSLCertificateKeyFile /tmp/httpd_inets/srv1.key SSLCACertificateFile /tmp/httpd_inets/01.pem $ +** dynamic content +Configuring httpd with {erl_script_alias, {"/d", [httpd_inets]}} and +compiling httpd_inets.erl will make the following URL refer to +httpd_inets:hello/3: + + https://localhost:8080/d/httpd_inets:hello + +Here's an example of what http_inets.erl can look like: + +$ cat httpd_inets.erl +-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>" + ]). +$ + +httpd config 'modules' seems to be crucial to get right, including the +order of the modules listed. The mod_esi module is the one providing +the erl_script_alias functionality. Here's a configuration that's +working with Erlang R15B01 (erts-5.9.1): + + {modules, [mod_alias, + mod_auth, + mod_esi, + mod_get, + mod_head, + mod_log, + mod_disk_log]}, |