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,42 +27,34 @@ 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:
$ sudo service lighttpd restart $ sudo service lighttpd restart
* 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
-------------------- --------------------
@ -74,7 +66,7 @@ do the following:
$ mkdir -p /opt/moth/mycontest $ mkdir -p /opt/moth/mycontest
$ ./install /opt/moth/mycontest $ ./install /opt/moth/mycontest
$ cp mothd /opt/moth $ cp mothd /opt/moth
Yay, you've got it set up. Yay, you've got it set up.
@ -84,7 +76,7 @@ Installing Puzzle Categories
Puzzle categories are distributed in a different way than the server. Puzzle categories are distributed in a different way than the server.
After setting up (see above), just run After setting up (see above), just run
$ /opt/moth/mycontest/bin/install-category /path/to/my/category $ /opt/moth/mycontest/bin/install-category /path/to/my/category
Running It Running It
------------- -------------