Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
121587a
)
examples: Added some commentary.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 6 Mar 2011 13:37:45 +0000
(14:37 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 6 Mar 2011 13:37:45 +0000
(14:37 +0100)
examples/python/dynhosts/dynhosts
patch
|
blob
|
blame
|
history
examples/python/dynhosts/run
patch
|
blob
|
blame
|
history
examples/static-files/run
patch
|
blob
|
blame
|
history
examples/vhosts/patterns.conf
patch
|
blob
|
blame
|
history
examples/vhosts/run
patch
|
blob
|
blame
|
history
diff --git
a/examples/python/dynhosts/dynhosts
b/examples/python/dynhosts/dynhosts
index
fae28c8
..
9a69a70
100755
(executable)
--- a/
examples/python/dynhosts/dynhosts
+++ b/
examples/python/dynhosts/dynhosts
@@
-5,6
+5,8
@@
from ashd import util
children = {}
root = sys.argv[1]
children = {}
root = sys.argv[1]
+
+# Automatically reap all children that die for any reason.
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
def serve(req):
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
def serve(req):
diff --git
a/examples/python/dynhosts/run
b/examples/python/dynhosts/run
index
fe81f84
..
d4203ea
100755
(executable)
--- a/
examples/python/dynhosts/run
+++ b/
examples/python/dynhosts/run
@@
-1,6
+1,12
@@
#!/bin/sh
#!/bin/sh
+# Change to the directory containing this script
set -e
cd "$(dirname "$0")"
set -e
cd "$(dirname "$0")"
+# Start htparser running this dynhosts script. The setsid command
+# ensures that SIGINT is only received by htparser and not by
+# dynhosts; it is not of grave importance, but makes shutdown slightly
+# more clean, and hides the KeyboardInterrupt otherwise raised by
+# Python.
htparser plain:port=8080 -- setsid ./dynhosts .
htparser plain:port=8080 -- setsid ./dynhosts .
diff --git
a/examples/static-files/run
b/examples/static-files/run
index
f667252
..
382c6bb
100755
(executable)
--- a/
examples/static-files/run
+++ b/
examples/static-files/run
@@
-1,6
+1,8
@@
#!/bin/sh
#!/bin/sh
+# Change to the directory containing this script
set -e
cd "$(dirname "$0")"
set -e
cd "$(dirname "$0")"
+# Simply invoke htparser running dirplex in this directory
htparser plain:port=8080 -- dirplex .
htparser plain:port=8080 -- dirplex .
diff --git
a/examples/vhosts/patterns.conf
b/examples/vhosts/patterns.conf
index
552f2d0
..
e73838d
100644
(file)
--- a/
examples/vhosts/patterns.conf
+++ b/
examples/vhosts/patterns.conf
@@
-1,13
+1,23
@@
-child default
- exec dirplex default-site
+# Sample virtual host configuration. See the patplex(1) manual page
+# for further details on the configuration format.
+
+match
+ # Match localhost specifically. Note that the Host header may
+ # include a port specification, which is optionally matched by the
+ # end of the regex.
+ header host ^localhost(:[0-9]+)?$ i
+ handler localhost
child localhost
child localhost
+ # The child specification called when the localhost pattern
+ # matches. Simply run dirplex(1) in the subdirectory `localhost'.
exec dirplex localhost
match
exec dirplex localhost
match
+ # Catch-all pattern for all requests not specifically directed at
+ # localhost.
default
handler default
default
handler default
-match
- header host localhost(:[0-9]+)?$ i
- handler localhost
+child default
+ exec dirplex default-site
diff --git
a/examples/vhosts/run
b/examples/vhosts/run
index
bba9e68
..
3c21690
100755
(executable)
--- a/
examples/vhosts/run
+++ b/
examples/vhosts/run
@@
-1,6
+1,9
@@
#!/bin/sh
#!/bin/sh
+# Change to the directory containing this script
set -e
cd "$(dirname "$0")"
set -e
cd "$(dirname "$0")"
+# Start htparser running patplex; see the patterns.conf file for
+# further details.
htparser plain:port=8080 -- patplex patterns.conf
htparser plain:port=8080 -- patplex patterns.conf