mirror of https://github.com/dirtbags/moth.git
Fixed some documentation on setting up lighttpd
This commit is contained in:
parent
b9f7b9c77e
commit
1bf6b5d725
26
README.md
26
README.md
|
@ -27,33 +27,23 @@ 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`:
|
|
||||||
|
|
||||||
$HTTP["host"] == "mycontest" {
|
|
||||||
server.document-root = "/opt/moth/mycontest/www"
|
|
||||||
cgi.assign = (".cgi" => "/usr/bin/lua")
|
cgi.assign = (".cgi" => "/usr/bin/lua")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue