Skip to content

Instantly share code, notes, and snippets.

@blt
Created December 7, 2010 20:18
Show Gist options
  • Save blt/732340 to your computer and use it in GitHub Desktop.
Save blt/732340 to your computer and use it in GitHub Desktop.
Layout of mongrel2 demo up to Manual section 4.5 and steps taken.
web_app_proxy = Proxy(addr='127.0.0.1', port=80)
chat_demo_dir = Dir(base='examples/chat/static/',
index_file='index.html',
default_ctype='text/plain')
chat_demo = Handler(send_spec='tcp://127.0.0.1:9999',
send_ident='54c6755b-9628-40a4-9a2d-cc82a816345e',
recv_spec='tcp://127.0.0.1:9998', recv_ident='')
handler_test = Handler(send_spec='tcp://127.0.0.1:9997',
send_ident='34f9ceee-cd52-4b7f-b197-88bf2f0ec378',
recv_spec='tcp://127.0.0.1:9996', recv_ident='')
mongrel2 = Host(name="localhost", routes={
'@chat': chat_demo,
'/handlertest': handler_test,
'/chat/': web_app_proxy,
'/': web_app_proxy,
'/chatdemo/': chat_demo_dir,
'/static/': chat_demo_dir,
'/mp3stream': Handler(
send_spec='tcp://127.0.0.1:9995',
send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
recv_spec='tcp://127.0.0.1:9994', recv_ident='')
})
main = Server(
uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="/home/blt/deployment/",
pid_file="/run/mongrel2.pid",
default_host="localhost",
name="main",
port=6767,
hosts=[mongrel2]
)
settings = {"zeromq.threads": 1}
servers = [main]
$ sudo procer $PWD $PWD/../run/procer.pid
[ERROR] (src/unixy.c:99: errno: No such file or directory) Failed to open PID file /home/blt/deployment/profiles/../run/procer.pid for reading.
[INFO] (src/unixy.c:138) No previous Mongrel2 running, continuing on.
$ ls /home/blt/deployment/profiles/../run/procer.pid
/home/blt/deployment/profiles/../run/procer.pid
$ pwd
/home/blt/deployment/profiles
$ sudo procer $PWD $PWD/../run/procer.pid
[ERROR] (src/unixy.c:99: errno: No such file or directory) Failed to open PID file /home/blt/deployment/profiles/../run/procer.pid for reading.
[INFO] (src/unixy.c:138) No previous Mongrel2 running, continuing on.
$ ls -lR /home/blt/deployment/
/home/blt/deployment/:
total 52
-rw-r--r-- 1 blt users 46080 Dec 7 15:08 config.sqlite
drwxr-xr-x 2 blt users 39 Dec 7 15:00 logs
-rw-r--r-- 1 blt users 1342 Dec 7 15:07 mongrel2.conf
drwxr-xr-x 7 blt users 106 Dec 7 15:06 profiles
drwxr-xr-x 2 blt users 37 Dec 7 15:16 run
drwxr-xr-x 2 blt users 6 Dec 7 14:39 static
drwxr-xr-x 2 blt users 6 Dec 7 14:39 tmp
/home/blt/deployment/logs:
total 64
-rw-r--r-- 1 blt users 0 Dec 7 14:59 access.log
-rw-r--r-- 1 blt root 1671 Dec 7 15:00 error.log
/home/blt/deployment/profiles:
total 32
drwxr-xr-x 2 blt users 59 Dec 7 15:04 chat
-rw-r--r-- 1 blt root 30968 Dec 7 15:16 error.log
drwxr-xr-x 2 blt users 59 Dec 7 15:04 handlertest
drwxr-xr-x 2 blt users 59 Dec 7 15:04 mongrel2
drwxr-xr-x 2 blt users 59 Dec 7 15:04 mp3stream
-rw-r--r-- 1 blt users 0 Dec 7 15:06 run.log
drwxr-xr-x 2 blt users 59 Dec 7 15:04 web
/home/blt/deployment/profiles/chat:
total 8
-rw-r--r-- 1 blt users 0 Dec 7 15:02 depends
-rw-r--r-- 1 blt users 44 Dec 7 15:03 pid_file
-rw-r--r-- 1 blt users 0 Dec 7 15:02 restart
-rwxr--r-- 1 blt users 10 Dec 7 15:04 run
/home/blt/deployment/profiles/handlertest:
total 8
-rw-r--r-- 1 blt users 0 Dec 7 15:02 depends
-rw-r--r-- 1 blt users 58 Dec 7 15:03 pid_file
-rw-r--r-- 1 blt users 0 Dec 7 15:02 restart
-rwxr--r-- 1 blt users 10 Dec 7 15:04 run
/home/blt/deployment/profiles/mongrel2:
total 8
-rw-r--r-- 1 blt users 0 Dec 7 15:02 depends
-rw-r--r-- 1 blt users 52 Dec 7 15:03 pid_file
-rw-r--r-- 1 blt users 0 Dec 7 15:02 restart
-rwxr--r-- 1 blt users 10 Dec 7 15:04 run
/home/blt/deployment/profiles/mp3stream:
total 8
-rw-r--r-- 1 blt users 0 Dec 7 15:02 depends
-rw-r--r-- 1 blt users 54 Dec 7 15:03 pid_file
-rw-r--r-- 1 blt users 0 Dec 7 15:02 restart
-rwxr--r-- 1 blt users 10 Dec 7 15:04 run
/home/blt/deployment/profiles/web:
total 8
-rw-r--r-- 1 blt users 0 Dec 7 15:02 depends
-rw-r--r-- 1 blt users 42 Dec 7 15:03 pid_file
-rw-r--r-- 1 blt users 0 Dec 7 15:02 restart
-rwxr--r-- 1 blt users 10 Dec 7 15:04 run
/home/blt/deployment/run:
total 4
srwxr-xr-x 1 blt users 0 Dec 7 15:00 control
-rw-r--r-- 1 root root 5 Dec 7 15:16 procer.pid
/home/blt/deployment/static:
total 0
/home/blt/deployment/tmp:
total 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment