<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hi</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm trying to use inets for the first time as
a http deamon & having trouble. Need any help from experts.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>what I did:</FONT></DIV>
<DIV><FONT face=Arial size=2>1.) copy the inets example server_root to the
</FONT><FONT face=Arial size=2>/tmp/vm/web/server_root/</FONT></DIV>
<DIV><FONT face=Arial size=2>2.) change all paths in httpd.conf to the
/tmp/vm/web/server_root/ & edit ErlScriptAlias as</FONT></DIV>
<DIV><FONT face=Arial size=2> ErlScriptAlias
/vm_db prof_db</FONT></DIV>
<DIV><FONT face=Arial size=2>3.) create vm_db folder as
/tmp/vm/web/server_root/vm_db</FONT></DIV>
<DIV><FONT face=Arial size=2>4.) as a test I just create prof_upd.erl as follows
& compile in the vm_db folder. (get the test function from
httpd_example.erl)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-module(prof_upd).<BR></FONT><FONT face=Arial
size=2></FONT></DIV>
<DIV><FONT face=Arial size=2>-export([test/2]).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>test(Env,Input)
-><BR> %%----------Server Side Out
Puts-----------<BR> InData =
httpd:parse_query(Input),<BR>
io:format("Env:~p~n",[Env]),<BR> io:format("GOT THIS:
~p~n",[InData]),<BR> %%----------Return to
client---------------<BR> %% Returning
this<BR> ["<HTML>",<BR>
"<HEAD>",<BR> "<TITLE> A Test Page
</TITLE>",<BR>
"</HEAD>",<BR>
"<BODY>",<BR> "<H1> A TEST
</H1>",<BR>
"</BODY>",<BR> "</HTML>"].</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>5.) create inets.config as folows</FONT></DIV>
<DIV><FONT face=Arial
size=2>[{inets,<BR> [{services,[{httpd,"/tmp/vm/web/server_root/conf/httpd.conf"}]}]<BR> }].</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>6.) start erlang using</FONT></DIV>
<DIV><FONT face=Arial size=2>erl -sname vm -config
/tmp/vm/web/server_root/conf/inets</FONT></DIV>
<DIV> </DIV>
<DIV>7.) start the inets as application:start(inets).</DIV>
<DIV> </DIV>
<DIV>8.) try to get the reqult using web browser from different mechine
i.e <A
href="http://192.168.1.95:8888/vm_db/prof_upd:test?a=qqq&b=eee">http://192.168.1.95:8888/vm_db/prof_upd:test?a=qqq&b=eee</A> </DIV>
<DIV> </DIV>
<DIV>what I get is:</DIV>
<DIV>
<H2 id=errortextcode style="FONT: 8pt/11pt verdana; COLOR: black">HTTP Error 403
- Forbidden <BR>Internet Explorer </H2>
<DIV style="FONT: 8pt/11pt verdana; COLOR: black"><FONT face=Arial size=2>What I
am doing wrong? why this happens? how to avoid this? are there any secutrity
applies? what's the proper way get a http request to inets from browser
& execute erlang code (ex: gen_sever:call) & send the result back? Need
help from inets expert</FONT></DIV>
<DIV style="FONT: 8pt/11pt verdana; COLOR: black"><FONT face=Arial
size=2></FONT> </DIV>
<DIV style="FONT: 8pt/11pt verdana; COLOR: black"><FONT face=Arial size=2>Thanks
in advance</FONT></DIV>
<DIV style="FONT: 8pt/11pt verdana; COLOR: black"><FONT face=Arial
size=2></FONT> </DIV>
<DIV style="FONT: 8pt/11pt verdana; COLOR: black"><FONT face=Arial
size=2>Sanjaya Vitharana</FONT></DIV></DIV></FONT></DIV></BODY></HTML>