public
Description: Yaws webserver
Home | Edit | New

Setup cgit

You need to setup an appmod, which we name cgit .
In your /etc/yaws.conf :

...
ebin_dir = /arkiv/home/www/site/www/cgit/ebi
...
 % in your server context
 appmods = <cgit , cgit>

Then we have the appmod, as shown below:

-module(cgit).                                                                                                 
-export([out/1]).                                                                                              
                                                                                                               
%%% Compile:  erlc -I /usr/local/lib -o ebin cgit.erl                                                          
                                                                                                               
-include_lib("yaws/include/yaws_api.hrl").                                                                     
                                                                                                               
out(Arg) ->                                                                                                    
    Pathinfo = Arg#arg.pathinfo,                                                                                                                                                              
    Env = [{"PATH_INFO", Pathinfo},                                                                            
           {"SCRIPT_NAME", "/cgit"}],                                                                                            
   yaws_cgi:call_cgi(Arg, undefined, script(), Pathinfo, Env).                                                 
                                                                                                               
script() ->                                                                                                    
    "/var/www/htdocs/cgit/cgit.cgi".     
Last edited by etnt, Tue Feb 24 11:39:35 -0800 2009
Home | Edit | New
Versions: