Fw: inets httpd - how to handle

Sanjaya Vitharana sanjaya@REDACTED
Thu Nov 10 08:39:08 CET 2005


reverting to my below mail:

ErlScriptAlias should be corrected as
    ErlScriptAlias /vm_db prof_upd

& Error should be corrected as

HTTP 500 - Internal server error 
Internet Explorer 

Sorry for my mistake

Sanjaya

----- Original Message ----- 
From: Sanjaya Vitharana 
To: erlang-questions@REDACTED 
Sent: Thursday, 10 November 2005 01:24 pm
Subject: inets httpd - how to handle


Hi

I'm trying to use inets for the first time as a http deamon & having trouble. Need any help from experts.

what I did:
1.) copy the inets example server_root to the /tmp/vm/web/server_root/
2.) change all paths in httpd.conf to the /tmp/vm/web/server_root/ & edit ErlScriptAlias as
       ErlScriptAlias /vm_db prof_db
3.) create vm_db folder as /tmp/vm/web/server_root/vm_db
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)

-module(prof_upd).

-export([test/2]).

test(Env,Input) ->
  %%----------Server Side Out Puts-----------
    InData = httpd:parse_query(Input),
    io:format("Env:~p~n",[Env]),
    io:format("GOT THIS: ~p~n",[InData]),
    %%----------Return to client---------------
    %% Returning this
    ["<HTML>",
     "<HEAD>",
     "<TITLE> A Test Page </TITLE>",
     "</HEAD>",
     "<BODY>",
     "<H1> A TEST </H1>",
     "</BODY>",
     "</HTML>"].

5.) create inets.config as folows
[{inets,
 [{services,[{httpd,"/tmp/vm/web/server_root/conf/httpd.conf"}]}]
 }].

6.) start erlang using
erl -sname vm -config /tmp/vm/web/server_root/conf/inets

7.) start the inets as application:start(inets).

8.) try to get the reqult using web browser from different mechine i.e http://192.168.1.95:8888/vm_db/prof_upd:test?a=qqq&b=eee 

what I get is:
HTTP Error 403 - Forbidden 
Internet Explorer 
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

Thanks in advance

Sanjaya Vitharana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20051110/bd6f487d/attachment.htm>


More information about the erlang-questions mailing list