Login
or
register
Overview
Overview
Why Lua?
Vision
Uses
Modules
General FAQ
Credits
License
Getting Started
Installation
Hello World
Databases
Web Servers
More Examples
Reference
FAQ
Getting Help
Status
News
Road Map
Releases
Site Edits
Community
Overview
Architecture
Detailed Road Map
Source
Builds
Bugs
FAQ
Dev Team
Mailing List
Xavante Examples
Anonymous users must enter
captcha
below.
Don't put anything here
Don't put anything here
Page Parameters
Page Name (for URL)
Page Title
Don't put anything here
Don't put anything here
Show Advanced Options
Category
Prototype
Page Content
The following code is an example of preparing Xavante to virtual host: <pre><code>-- $SYSCONFDIR/kepler/1.1/xavante/config.lua require "xavante.filehandler" require "xavante.cgiluahandler" require "xavante.redirecthandler" local function makerules(webDir) return { { -- URI remapping example match = "/", with = xavante.redirecthandler, params = { "index.lp", "index.lua", "index.http" } }, { -- filehandler example match = "/*", with = xavante.filehandler, params = { baseDir = webDir } }, { -- cgiluahandler example match = { "/*.lp", "/*.lua" }, with = xavante.cgiluahandler.makeHandler(webDir) }, } end -- Displays a message in the console with the used ports xavante.start_message(function (ports) local date = os.date "[%Y-%m-%d %H:%M:%S]" print( ("%s Xavante started on port(s) %s"):format( date, table.concat(ports, ", ") ) ) end) xavante.HTTP { server = { host = "*", port = 8080 }, defaultHost = { rules = makerules(XAVANTE_WEB) }, --virtualhosts = { -- ["www.client1.com"] = { rules = makerules "/home/client1" }, -- ["www.client2.com"] = { rules = makerules "/home/client2" }, -- ["www.client3.com"] = { rules = makerules "/home/client3" }, --}, }</code></pre>
Don't put anything here
About this Edit
Minor Edit
Edit Summary
Don't put anything here
Powered by
Sputnik
|
XHTML 1.1