annotate doc/lighttpd.sample.conf @ 91:2f8d8edd1836
URL parsing inside WebMCP to simplify webserver configuration
 | author | 
 jbe | 
 | date | 
 Wed Oct 10 17:41:46 2012 +0200 (2012-10-10) | 
 | parents | 
 9fdfb27f8e67  | 
 | children | 
 db4bf2e6513c  | 
 
 | rev | 
   line source | 
| 
jbe/bsw@0
 | 
     1 # Lighttpd modules needed by WebMCP
 | 
| 
jbe/bsw@0
 | 
     2 server.modules += (
 | 
| 
jbe/bsw@0
 | 
     3   "mod_cgi",
 | 
| 
jbe/bsw@0
 | 
     4   "mod_alias",
 | 
| 
jbe/bsw@0
 | 
     5   "mod_setenv",
 | 
| 
jbe/bsw@0
 | 
     6   "mod_rewrite",
 | 
| 
jbe/bsw@0
 | 
     7   "mod_redirect",
 | 
| 
jbe/bsw@0
 | 
     8  )
 | 
| 
jbe/bsw@0
 | 
     9 
 | 
| 
jbe/bsw@0
 | 
    10 # Enable CGI-Execution of *.lua files through lua binary
 | 
| 
jbe/bsw@0
 | 
    11 cgi.assign += ( ".lua" => "/__INSERT_LOCAL_FILE_PATH_TO_LUA_BINARY_HERE__/lua" )
 | 
| 
jbe/bsw@0
 | 
    12 
 | 
| 
jbe/bsw@0
 | 
    13 # Connect external URLs to server static files and the webmcp cgi interface
 | 
| 
jbe/bsw@0
 | 
    14 alias.url += (
 | 
| 
jbe/bsw@0
 | 
    15   "/webmcp-demo/static/" => "/__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__/static/",
 | 
| 
jbe/bsw@0
 | 
    16   "/webmcp-demo/"        => "/__INSERT_LOCAL_FILE_PATH_TO_WEBMCP_FRAMEWORK_HERE__/cgi-bin/" )
 | 
| 
jbe/bsw@0
 | 
    17 
 | 
| 
jbe/bsw@0
 | 
    18 # Configure environment for demo application    
 | 
| 
jbe/bsw@0
 | 
    19 $HTTP["url"] =~ "^/webmcp-demo/" {
 | 
| 
jbe/bsw@0
 | 
    20   setenv.add-environment += (
 | 
| 
jbe/bsw@0
 | 
    21     "WEBMCP_APP_BASEPATH" => "/__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__",
 | 
| 
jbe/bsw@0
 | 
    22     "WEBMCP_CONFIG_NAME"  => "demo")
 | 
| 
jbe/bsw@0
 | 
    23 }
 | 
| 
jbe/bsw@0
 | 
    24 
 | 
| 
jbe/bsw@0
 | 
    25 # URL beautification
 | 
| 
jbe/bsw@0
 | 
    26 url.rewrite-once += (
 | 
| 
jbe/bsw@0
 | 
    27 
 | 
| 
jbe/bsw@0
 | 
    28   # do not rewrite static URLs
 | 
| 
jbe/bsw@0
 | 
    29       "^/webmcp-demo/static/(.*)$" =>
 | 
| 
jbe/bsw@0
 | 
    30       "/webmcp-demo/static/$1",
 | 
| 
jbe/bsw@0
 | 
    31 
 | 
| 
jbe@91
 | 
    32   # dynamic URLs
 | 
| 
jbe@91
 | 
    33       "^/webmcp-demo/([^\?])(\?(.*))?$" =>
 | 
| 
jbe@91
 | 
    34       "/webmcp-demo/webmcp-wrapper.lua?_webmcp_path=$1&$2",
 | 
| 
jbe/bsw@0
 | 
    35 
 | 
| 
jbe/bsw@0
 | 
    36 )
 | 
| 
jbe/bsw@0
 | 
    37 
 | 
| 
jbe/bsw@0
 | 
    38 # Redirects for URLs without trailing slashes
 | 
| 
jbe/bsw@0
 | 
    39 url.redirect += (
 | 
| 
jbe/bsw@0
 | 
    40   # base URL without trailing slash
 | 
| 
jbe/bsw@0
 | 
    41       "^/webmcp-demo$" => "/webmcp-demo/",
 | 
| 
jbe/bsw@0
 | 
    42   # module base URL without trailing slash
 | 
| 
jbe/bsw@0
 | 
    43       "^/webmcp-demo/([^/\?]+)$" => "/webmcp-demo/$1/",
 | 
| 
jbe/bsw@0
 | 
    44 )
 |