Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Setup cgit

etnt edited this page · 2 revisions

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".     
Something went wrong with that request. Please try again.