Skip to content

Yaws and trac

klacke edited this page Sep 13, 2010 · 1 revision

Trac is an amazingly good bugtracking system. To run under Yaws.

1. yaws.conf

......

 <server wiki.tail-f.com>

  port   = 443
  listen = 192.168.1.43
  appmods = </viewvc , viewvc> </trac , trac>
  docroot = /store/wiki/wiki

  <auth>

    dir = /

    realm = My-wiki

    user ........

2.

  1. cat trac.erl

-module(trac).

-export([out/1]).

-include_lib("yaws/include/yaws_api.hrl").

out(Arg) ->
   Pathinfo = Arg#arg.appmoddata,
   RemoteUser = case (Arg#arg.headers)#headers.authorization of
                    {User, _Pass, _Type} ->
                        [{"REMOTE_USER", User}];
                    _ ->
                        []
                end,
   Env = [{"SCRIPT_NAME", "/trac"},
          {"TRAC_ENV", "/store/wiki/trac"}] ++ RemoteUser,
   yaws_cgi:call_cgi(Arg, undefined, script(), Pathinfo, Env).



script() ->
   "/usr/local/share/trac/cgi-bin/trac.cgi".


3.

# cat viewvc.erl

-module(viewvc).

-export([out/1]).

-include_lib("yaws/include/yaws_api.hrl").

out(Arg) ->
   Pathinfo = Arg#arg.appmoddata,
   Env = [{"SCRIPT_NAME", "/viewvc/"}],
   yaws_cgi:call_cgi(Arg, undefined, script(), Pathinfo, Env).


script() ->
  "/usr/local/viewvc-1.0-dev/bin/cgi/viewcvs.cgi".

Something went wrong with that request. Please try again.