summaryrefslogtreecommitdiffstats
path: root/run-server.sh
blob: ad67263ee96d86cc2a1731e4674da272acc1fcd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# Copyright (c) 2012-2014 Kaarle Ritvanen
# See LICENSE file for license details

export AUGEAS_LENS_LIB=augeas

if [ $(basename $0) = run-server.sh ]; then
    export LUA_PATH="./?.lua;./?/init.lua;;"
    PORT=${1:-8000}
    OPTIONS=
    cd $(dirname $0)
else
    PORT=80
    OPTIONS="-d /var/log/aconf.log --pidfile /var/run/aconf.pid"
    cd /usr/share/aconf
fi

exec uwsgi -M --http-socket :$PORT --close-on-exec2 \
    --plugin /usr/lib/uwsgi/lua_plugin.so --lua server.lua \
    --remap-modifier 6:0 \
    --static-map /browser=web --static-index client.xhtml \
    $OPTIONS