webmcp

diff doc/lighttpd.sample.conf @ 0:9fdfb27f8e67

Version 1.0.0
author jbe/bsw
date Sun Oct 25 12:00:00 2009 +0100 (2009-10-25)
parents
children 2f8d8edd1836
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/lighttpd.sample.conf	Sun Oct 25 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +# Lighttpd modules needed by WebMCP
     1.5 +server.modules += (
     1.6 +  "mod_cgi",
     1.7 +  "mod_alias",
     1.8 +  "mod_setenv",
     1.9 +  "mod_rewrite",
    1.10 +  "mod_redirect",
    1.11 + )
    1.12 +
    1.13 +# Enable CGI-Execution of *.lua files through lua binary
    1.14 +cgi.assign += ( ".lua" => "/__INSERT_LOCAL_FILE_PATH_TO_LUA_BINARY_HERE__/lua" )
    1.15 +
    1.16 +# Connect external URLs to server static files and the webmcp cgi interface
    1.17 +alias.url += (
    1.18 +  "/webmcp-demo/static/" => "/__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__/static/",
    1.19 +  "/webmcp-demo/"        => "/__INSERT_LOCAL_FILE_PATH_TO_WEBMCP_FRAMEWORK_HERE__/cgi-bin/" )
    1.20 +
    1.21 +# Configure environment for demo application    
    1.22 +$HTTP["url"] =~ "^/webmcp-demo/" {
    1.23 +  setenv.add-environment += (
    1.24 +    "WEBMCP_APP_BASEPATH" => "/__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__",
    1.25 +    "WEBMCP_CONFIG_NAME"  => "demo")
    1.26 +}
    1.27 +
    1.28 +# URL beautification
    1.29 +url.rewrite-once += (
    1.30 +
    1.31 +  # do not rewrite static URLs
    1.32 +      "^/webmcp-demo/static/(.*)$" =>
    1.33 +      "/webmcp-demo/static/$1",
    1.34 +
    1.35 +  # base URL
    1.36 +      "^/webmcp-demo/(\?(.*))?$" =>
    1.37 +      "/webmcp-demo/webmcp-wrapper.lua?_webmcp_urldepth=0&_webmcp_module=index&_webmcp_view=index&$2",
    1.38 +
    1.39 +  # module base URLs
    1.40 +      "^/webmcp-demo/([^/\?]+)/(\?(.*))?$" =>
    1.41 +      "/webmcp-demo/webmcp-wrapper.lua?_webmcp_urldepth=1&_webmcp_module=$1&_webmcp_view=index&$3",
    1.42 +
    1.43 +  # actions
    1.44 +      "^/webmcp-demo/([^/\?]+)/([^/\.\?]+)(\?(.*))?$" =>
    1.45 +      "/webmcp-demo/webmcp-wrapper.lua?_webmcp_urldepth=1&_webmcp_module=$1&_webmcp_action=$2&$4",
    1.46 +
    1.47 +  # views without numeric id or string ident
    1.48 +      "^/webmcp-demo/([^/\?]+)/([^/\.\?]+)\.([^/\?]+)(\?(.*))?$" =>
    1.49 +      "/webmcp-demo/webmcp-wrapper.lua?_webmcp_urldepth=1&_webmcp_module=$1&_webmcp_view=$2&_webmcp_suffix=$3&$5",
    1.50 +
    1.51 +  # views with numeric id or string ident
    1.52 +      "^/webmcp-demo/([^/\?]+)/([^/\?]+)/([^/\.\?]+)\.([^/\?]+)(\?(.*))?$" =>
    1.53 +      "/webmcp-demo/webmcp-wrapper.lua?_webmcp_urldepth=2&_webmcp_module=$1&_webmcp_view=$2&_webmcp_id=$3&_webmcp_suffix=$4&$6",
    1.54 +
    1.55 +)
    1.56 +
    1.57 +# Redirects for URLs without trailing slashes
    1.58 +url.redirect += (
    1.59 +  # base URL without trailing slash
    1.60 +      "^/webmcp-demo$" => "/webmcp-demo/",
    1.61 +  # module base URL without trailing slash
    1.62 +      "^/webmcp-demo/([^/\?]+)$" => "/webmcp-demo/$1/",
    1.63 +)

Impressum / About Us