我有一个模块,我想把它变成一个合适的OTP应用程序。目前,模块有start/0,它启动一个genserver,它提供从配置文件读取的配置数据。然后它调用inets:start(httpd,config:lookup(httpd_conf))。我想我需要将这些文件的开头移到.app文件的(应用程序列表)中,但是我不确定如何将我的配置数据放入到inets中:启动函数(或传入httpd)?
谢谢,--蒂姆
发布于 2010-03-30 00:04:46
这是我想出来的..。
首先,我需要创建inets配置文件:
inets.config:
[{inets, [{services, [{httpd, [{proplist_file,
"8080.conf"}]},
].然后,创建httpd conf文件:
8080.conf
[
{modules, [
mod_alias,
mod_auth,
mod_esi,
mod_actions,
mod_cgi,
mod_dir,
mod_get,
mod_head,
mod_log,
mod_disk_log
]},
{port,8080},
{server_name,"hello_world"},
{server_root,"log"},
{document_root,"www"},
{erl_script_alias, {"/erl", [hello_world]}},
{error_log, "error.log"},
{security_log, "security.log"},
{transfer_log, "transfer.log"},
{mime_types,[
{"html","text/html"},
{"css","text/css"},
{"js","application/x-javascript"}
]}
]现在,在启动我的应用程序时,我只使用以下命令引用inets.conf文件:
$ erl -boot start_sasl -pa ebin -config inets.config这似乎是有效的,不确定这是不是“正确”的方式...
https://stackoverflow.com/questions/2538492
复制相似问题