On Mon, Mar 24, 2014 at 12:47 PM, <yaws@poetmail.net> wrote:
I've been using a (very) old version of YAWS with a bunch of appmods
that worked nicely.

I've just installed version 1.98 and now I find my pre-compiled beam
files don't work and I'm unable to compile afresh.

Example of protect_inc.erl, source:


%% This module rewrites requests for a protected path to the
errormod_404 handler
%% Note that paths are converted to lower case and hard-coded in the
case line

arg_rewrite(Arg) ->
   Req = Arg#arg.req,
   {abs_path,Path} = Req#http_request.path,
   try yaws_api:url_decode_q_split(Path) of
     {DecPath,_Query} ->
       case string:to_lower(string:sub_string(DecPath,1,10)) ==
"/forbidden" orelse string:str(DecPath,".htaccess") > 0 of
         true ->
           Arg#arg{req = Req#http_request{path = {abs_path,"/err.php"}}};
         false ->
     exit:_ ->

When I try c(protect_inc.erl). I get:

* 1: syntax error before: '.'

If I drop my existing (old) pre-compiled protect_inc.beam into
/usr/local/lib/yaws/ebin (and invoke it with arg_rewrite_mod =
protect_inc in the server config) I get:

Yaws process died: {{badrecord,arg},

I'm sure the problem & solution is obvious to someone but not me

The second error is due to the fact that the #arg{} record occasionally changes from release to release -- a recompile will fix that. So let's focus on the first problem instead. What version of Erlang were you using before, and what version are you trying to use now?