Fixed some documentation on setting up lighttpd

This commit is contained in:
Jack Miner 2016-02-22 01:12:24 -07:00
parent b9f7b9c77e
commit 1bf6b5d725
1 changed files with 14 additions and 22 deletions

View File

@ -27,34 +27,24 @@ for details.
Dependencies Dependencies
-------------------- --------------------
If you're using Ubuntu 14.04 LTS, you should have everything you need except If you're using Xubuntu 14.04 LTS, you should have everything you need except
[LUA](http://lua.org). [LUA](http://lua.org).
$ sudo apt-get install lua5.2 -y $ sudo apt-get install lua5.2 -y
You'll also have to figure out a way to serve up CGI. Here's one way to do it You'll also have to figure out a way to serve up CGI. Here's one way to do it
on Ubuntu 14.04 LTS with [lighttpd](https://lighttpd.net) where the contest on Xubuntu 14.04 LTS with [lighttpd](https://lighttpd.net) where the contest is at `/opt/moth/mycontest`:
is at `/opt/moth/mycontest` accessible by user group `moth`, and the web
server is run as user `www-data`:
First, make sure your web server can access the contest files: First, install lighttpd and backup the configuration:
$ sudo usermod -a -G moth www-data $ sudo apt-get install lighttpd -y
Next, install lighttpd and backup the configuration:
$ sudo apt-get install lighttpd
$ cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig $ cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig
Add an entry for your contest to your `/etc/hosts`: Add `mod_cgi` to the `ServerModules` section, an alias, and CGI handling to `/etc/lighttpd/lighttpd.conf`:
127.0.0.1 mycontest alias.url = ("/moth" => "/opt/moth/mycontest/www")
$HTTP["url"] =~ "/moth/" {
Add a virtual host entry to `/etc/lighttpd/lighttpd.conf`: cgi.assign = (".cgi" => "/usr/bin/lua")
$HTTP["host"] == "mycontest" {
server.document-root = "/opt/moth/mycontest/www"
cgi.assign = ( ".cgi" => "/usr/bin/lua" )
} }
Finally, restart your server: Finally, restart your server:
@ -63,6 +53,8 @@ Finally, restart your server:
* Stopping web server lighttpd [ OK ] * Stopping web server lighttpd [ OK ]
* Starting web server lighttpd [ OK ] * Starting web server lighttpd [ OK ]
Your server should now be serving up the contest!
How to set it up How to set it up
-------------------- --------------------