[Erlangweb-users] [?] *.yaws and *.cgi and fossil
Brought to you by:
etcerlangweb,
paulgray
|
From: Michael M. <erl...@au...> - 2009-09-01 03:30:13
|
Hi, List. I want to run *.yaws and *.cgi files via erlang-web. Well, actually, I want to be able to serve fossil [http://fossil-scm.org] repositories from within erlang-web (using yaws as backend), I'm not particularly stuck on using *.yaws and *.cgi though that is how I ran fossil using yaws alone. If I am only running yaws then I can do, e.g. the following to display (and work with) a fossil repository : /usr/local/etc/yaws/yaws.conf ... <server localhost> port = 80 listen = 127.0.0.1 docroot = /usr/local/var/yaws/www appmods = <cgi-bin, yaws_appmod_cgi> </server> --- /usr/local/var/yaws/www/block_clone.yaws <erl> out(Arg) -> yaws_cgi:call_cgi(Arg, "/usr/local/var/yaws/www/cgi-bin/block_clone.cgi"). </erl> --- /usr/local/var/yaws/www/cgi-bin/block_clone.cgi #!/usr/local/bin/fossil repository: /tmp/cloned_repositories/block_clone.fossil -- and, when pointing browser at http://localhost/block_clone.yaws/ I get the fossil index page, and all the links work. --- and, for Erlang Web, I have tried various combinations of, e.g. templates/fossil.html <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Fossil repositories</title> <script src="cgi/foo.cgi" type="text/html"> </script> </head> </html> ^^^^^^^^^^^^^ also changed this to "fossil.yaws" which calls the cgi file The cgi file is executable. The repository is readable. The cgi directory is a subdirectory of templates directory. So, how can I serve fossil repositories via erlang-web whether with *.yaws and cgi or not. Of course, using yaws as the backend web server for Erlang Web. I tried similar configuration and various combinations in dispatch.conf, e.g. {static, "^/fossil$", "fossil.yaws"}. but the best I can get is no error and a blank page in the browser. Please if you have a suggestion (especially one you have used successfully) to run *.yaws and *.cgi within Erlang Web, please provide it. If there is online documentation I have not found it so a pointer to docs which may help out would be appreciated as well. Also, the above is the simplest case of delivering a single fossil repository. I actually plan to provide multiple repositories (which I have done using yaws only) as described here, http://www.fossil-scm.org/index.html/wiki?name=Cookbook#CGI I think I am missing something basic because even a simple hello.cgi gives a blank page #!/bin/bash echo "hello" ~Michael |