gdritter repos melvil / d344f03
Updated README, too Getty Ritter 8 years ago
1 changed file(s) with 17 addition(s) and 17 deletion(s). Collapse all Expand all
1 # aloysius
1 # melvil
22
33 **EARLY AND EXPERIMENTAL**
44
5 Aloysius is the HTTP server interface I want to use. It's very
5 Melvil is the HTTP server interface I want to use. It's very
66 slow at present, and still quite early, but it's at least a
77 proof-of-concept of something I think should exist.
88
99 ## Basic Use
1010
11 The Aloysius server does nothing but pass HTTP requests and
11 The Melvil server does nothing but pass HTTP requests and
1212 responses between other servers: it is, in effect, a mechanism
1313 for establishing reverse proxies.
1414
4343
4444 - The `mode` field tells us _how_ to forward requests. There are
4545 three possible forwarding modes:
46 - If the mode is `http`, then Aloysius will forward the HTTP
46 - If the mode is `http`, then Melvil will forward the HTTP
4747 request to the server listening on the host `host` and the
4848 port `port`.
49 - If the mode is `aloys`, then Aloysius will recursively check
49 - If the mode is `melvil`, then Melvil will recursively check
5050 the configuration directory at `conf`.
51 - If the mode is `redir`, then Aloysius will respond with an
51 - If the mode is `redir`, then Melvil will respond with an
5252 HTTP response code as indicated in `resp` and redirect to
5353 the host as indicated in `host`.
5454
6262 to that user on a per-subdomain basis:
6363
6464 ~~~
65 $ mkdir -p /var/run/aloys
66 $ for U in $USERS
67 > do
65 $ mkdir -p /etc/melvil
66 $ for U in $USERS; do
6867 > # find the user's home directory
6968 > HOMEDIR=`cat /etc/passwd | grep ${U} | cut -d ':' -f 6`
7069 >
7170 > # add a configuration directory to each user
72 > mkdir -p ${HOMEDIR}/aloys
73 > chown ${U} ${HOMEDIR}/aloys
71 > mkdir -p ${HOMEDIR}/melvil
72 > chown ${U} ${HOMEDIR}/melvil
7473 >
7574 > # add a new forwarding rule for each user
76 > mkdir -p /var/run/aloys/${U}-local
77 > # make ${U}.example.com forward to the user's aloys configuration
78 > echo "${U}.example.com" >/var/run/aloys/user-${U}/domain
79 > echo "aloys" >/var/run/aloys/user-${U}/mode
80 > echo "${HOMEDIR}/aloys" >/var/run/aloys/user-${U}/conf
75 > mkdir -p /etc/${U}-local
76 >
77 > # make ${U}.example.com forward to the user's melvil configuration
78 > echo "${U}.example.com" >/melvil/user-${U}/domain
79 > echo "melvil" >/melvil/user-${U}/mode
80 > echo "${HOMEDIR}/melvil" >/melvil/user-${U}/conf
8181 > done
82 $ aloysius /var/run/aloys
82 $ aloysius /etc/melvil
8383 ~~~
8484
8585 Now, if a given user wants to set up a local HTTP server that