Taking the example out of the document at <a href="http://www.erlang.org/doc/apps/inets/http_server.html">http://www.erlang.org/doc/apps/inets/http_server.html</a>:<br><br>2> {ok, Pid} = inets:start(httpd, [{port, 0},<br>
2>       {server_name,"httpd_test"}, {server_root,"/tmp"},<br>2>       {document_root,"/tmp/htdocs"}, {bind_address, "localhost"}]).<br><br>=ERROR REPORT==== 30-Jun-2008::17:47:18 ===<br>
Failed initiating web server: <br>undefined<br><b>{wrong_type,{document_root,"/tmp/htdocs"}}</b><br><br>** exception error: no match of right hand side value {error,{shutdown,{child,undefined,<br>                                                                              {httpd_instance_sup,{0,0,0,0,0,0,0,1},59104},<br>
                                                                              {httpd_instance_sup,start_link,<br>                                                                                                  [[{port,59104},<br>
                                                                                                    {bind_address,{0,0,0,0,0,0,0,1}},<br>                                                                                                    {server_name,"httpd_test"},<br>
                                                                                                    {server_root,"/tmp"},<br>                                                                                                    {document_root,"/tmp/htdocs"}],<br>
                                                                                                   15000,<br>                                                                                                   {<0.50.0>,#Port<0.126>},<br>
                                                                                                   []]},<br>                                                                              permanent,infinity,supervisor,<br>                                                                              [httpd_instance_sup]}}}<br>
<br>The actual problem was that the "/tmp/htdocs" directory did not exist. I find having an error message of undefined <b>{wrong_type,{document_root,"/tmp/htdocs"}} </b>to be very misleading. I read it as "the value corresponding to document_root [i.e. "/tmp/htdocs", of type string] is of the wrong type". If not a string, what should it be, I wondered?<br>
<br>When I created the directory and tried again, the message went away. I would have expected to see something like {does_not_exist,{document_root,"/tmp/htdocs"}}.<br><br>3> {ok, Pid} = inets:start(httpd, [{port, 0},                         <br>
3>       {server_name,"httpd_test"}, {server_root,"/tmp"},<br>3>       {document_root,"/tmp/htdocs"}, {bind_address, "localhost"}]).<br>{ok,<0.58.0>}<br>4> <br><br clear="all">
Regards,<br>Edwin Fine<br>-- <br>The great enemy of the truth is very often not the lie -- deliberate, contrived and dishonest, but the myth, persistent, persuasive, and unrealistic. Belief in myths allows the comfort of opinion without the discomfort of thought.<br>
John F. Kennedy 35th president of US 1961-1963 (1917 - 1963)