Skip to content

Commit

Permalink
fix; zero-relay
Browse files Browse the repository at this point in the history
  • Loading branch information
dvv committed Sep 29, 2011
1 parent 7d52610 commit 8d0947f
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 92 deletions.
9 changes: 9 additions & 0 deletions 0mq/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
all: bin

bin: relay

relay: relay.c
gcc -o $@ $^ -lzmq
strip -s $@

.PHONE: all bin
4 changes: 2 additions & 2 deletions Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ check:
#bin: $(ZEROMQNODE)/binding.node #bin: $(ZEROMQNODE)/binding.node
#bin: $(ZEROMQ)/src/.libs/libzmq.a #bin: $(ZEROMQ)/src/.libs/libzmq.a
#bin: $(MONGO)/bin/mongo $(HAPROXY)/haproxy $(STUD)/$(STUD_TARGET) $(REDIS)/src/redis-server $(RUNIT)/runsvdir $(LIGHTTPD)/src/lighttpd #bin: $(MONGO)/bin/mongo $(HAPROXY)/haproxy $(STUD)/$(STUD_TARGET) $(REDIS)/src/redis-server $(RUNIT)/runsvdir $(LIGHTTPD)/src/lighttpd
#bin: $(LIGHTTPD)/src/lighttpd bin: $(LIGHTTPD)/src/lighttpd
bin: $(HAPROXY)/haproxy #bin: $(HAPROXY)/haproxy
#bin: $(NGINX)/src/nginx #bin: $(NGINX)/src/nginx
#bin: $(STUD)/$(STUD_TARGET) #bin: $(STUD)/$(STUD_TARGET)


Expand Down
2 changes: 1 addition & 1 deletion service/farm/conf
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
ADMIN_URI=/haproxy?stats ADMIN_URI=/haproxy?stats


HTTP_SERVER=0.0.0.0:80 HTTP_SERVER=0.0.0.0:80
HTTPS_PORT=0.0.0.0:443 HTTPS_SERVER=0.0.0.0:443
HTTPS_TERMINATED_SERVER=127.0.0.1:65443 HTTPS_TERMINATED_SERVER=127.0.0.1:65443


STUD_PARAMS='-B 2048 -C 16384 -c DHE-RSA-AES256-SHA --ssl' # N.B. --ssl due to older chrome errors... STUD_PARAMS='-B 2048 -C 16384 -c DHE-RSA-AES256-SHA --ssl' # N.B. --ssl due to older chrome errors...
Expand Down
9 changes: 6 additions & 3 deletions service/farm/http/balance/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ defaults
option allbackups option allbackups
option dontlognull option dontlognull
option forwardfor except 127.0.0.1 header X-Forwarded-For option forwardfor except 127.0.0.1 header X-Forwarded-For
http-check disable-on-404
log global log global
option httplog option httplog
option log-separate-errors option log-separate-errors
Expand All @@ -43,7 +42,6 @@ defaults
stats uri $ADMIN_URI stats uri $ADMIN_URI
stats hide-version stats hide-version
#stats refresh 3s #stats refresh 3s
stats admin if LOCALHOST
frontend farm frontend farm
Expand Down Expand Up @@ -76,6 +74,7 @@ frontend farm
backend rpc backend rpc
option httpchk GET /haproxy?monitor option httpchk GET /haproxy?monitor
http-check disable-on-404
server s1 $WORKER_1 check cookie s1 server s1 $WORKER_1 check cookie s1
server s2 $WORKER_2 check cookie s2 server s2 $WORKER_2 check cookie s2
server s3 $WORKER_3 check cookie s3 server s3 $WORKER_3 check cookie s3
Expand All @@ -87,9 +86,12 @@ backend rpc
timeout server 25s timeout server 25s
timeout http-keep-alive 1 timeout http-keep-alive 1
stats admin if LOCALHOST
backend websocket backend websocket
option httpchk GET /haproxy?monitor option httpchk GET /haproxy?monitor
http-check disable-on-404
server s1 $WORKER_1 check cookie s1 server s1 $WORKER_1 check cookie s1
server s2 $WORKER_2 check cookie s2 server s2 $WORKER_2 check cookie s2
server s3 $WORKER_3 check cookie s3 server s3 $WORKER_3 check cookie s3
Expand All @@ -105,7 +107,8 @@ backend websocket
backend http backend http
option httpchk GET /index.html option httpchk GET /$STATIC_INDEX
http-check disable-on-404
server s1 $STATIC_1 check server s1 $STATIC_1 check
server s2 $STATIC_2 check backup server s2 $STATIC_2 check backup
Expand Down
38 changes: 0 additions & 38 deletions service/farm/http/static-backup/conf

This file was deleted.

48 changes: 47 additions & 1 deletion service/farm/http/static-backup/run
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1,48 @@
#!/bin/sh #!/bin/sh
exec nginx -c $PWD/conf 2>&1 #exec nginx -c $PWD/conf 2>&1

. ../../conf
cat >.conf <<_EOF_
user web;
worker_processes 1;
daemon off;
pid $PWD/.pid;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
events {
worker_connections 16384;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log /dev/stdout;
access_log /dev/null;
sendfile on;
#tcp_nopush on;
keepalive_timeout 70;
#gzip on;
server {
server_name localhost;
listen $STATIC_2;
root $STATIC_ROOT;
location / {
index $STATIC_INDEX;
}
}
}
_EOF_

exec nginx -c $PWD/.conf 2>&1
40 changes: 0 additions & 40 deletions service/farm/http/static/conf

This file was deleted.

4 changes: 2 additions & 2 deletions service/farm/http/static/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#exec nginx -c $PWD/conf 2>&1 #exec nginx -c $PWD/conf 2>&1


. ../../conf . ../../conf
cat >conf <<_EOF_ cat >.conf <<_EOF_
user web; user web;
worker_processes 1; worker_processes 1;
Expand Down Expand Up @@ -45,4 +45,4 @@ http {
_EOF_ _EOF_


exec nginx -c $PWD/conf 2>&1 exec nginx -c $PWD/.conf 2>&1
2 changes: 1 addition & 1 deletion service/farm/https-haproxy/65444/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ../../conf . ../../conf
ulimit -n 100000 ulimit -n 100000


exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1 exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
2 changes: 1 addition & 1 deletion service/farm/https-haproxy/65445/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ../../conf . ../../conf
ulimit -n 100000 ulimit -n 100000


exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1 exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
2 changes: 1 addition & 1 deletion service/farm/https-haproxy/65446/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ../../conf . ../../conf
ulimit -n 100000 ulimit -n 100000


exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1 exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
2 changes: 1 addition & 1 deletion service/farm/https-haproxy/65447/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ../../conf . ../../conf
ulimit -n 100000 ulimit -n 100000


exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1 exec stud -n 1 -u stud -q dummy -f 127.0.0.1,${PWD##*/} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
2 changes: 1 addition & 1 deletion service/farm/https/run
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ../conf . ../conf
ulimit -n 100000 ulimit -n 100000


exec stud -n 1 -u stud -q dummy -f \*,$HTTPS_PORT -b 127.0.0.1,$HAPROXY_HTTP_LOCAL_PORT --write-proxy $STUD_PARAMS -- site.pem 2>&1 exec stud -n 1 -u stud -q dummy -f ${HTTPS_SERVER/:/,} -b ${HTTPS_TERMINATED_SERVER/:/,} --write-proxy $STUD_PARAMS -- site.pem 2>&1
2 changes: 2 additions & 0 deletions service/farm/zero-relay/log/run
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec chpst svlogd -tt .
1 change: 1 addition & 0 deletions service/farm/zero-relay/messages
5 changes: 5 additions & 0 deletions service/farm/zero-relay/run
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

. ../conf

exec chpst -u web zero-relay 2>&1

0 comments on commit 8d0947f

Please sign in to comment.