Skip to content

Commit

Permalink
Restore old runscripts for backwards compatibility.
Browse files Browse the repository at this point in the history
These are still deprecated, but they are necessary
to keep running if you installed before the Natty
installer.
  • Loading branch information
spladug committed Sep 20, 2011
1 parent bf6c671 commit de2102e
Show file tree
Hide file tree
Showing 12 changed files with 576 additions and 0 deletions.
460 changes: 460 additions & 0 deletions config/cassandra/cassandra.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions srv/cassandra/log/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
umask 0027
exec setuidgid reddit multilog ./main
6 changes: 6 additions & 0 deletions srv/cassandra/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

ulimit -n 32768

exec 2>&1
exec setuidgid reddit cassandra -f
74 changes: 74 additions & 0 deletions srv/haproxy/haproxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

global
maxconn 100000
spread-checks 50
#stats socket /tmp/haproxy mode 777


frontend frontend 0.0.0.0:80
mode http
maxconn 50000
timeout client 10000
option forwardfor except 127.0.0.1
option httpclose

option httplog
log /dev/log local4
capture request header User-Agent len 150
capture request header Host len 50
capture request header Referer len 300
capture request header X-Forwarded-For len 15
capture request header True-Client-Ip len 15
capture request header If-Modified-Since len 50
capture cookie reddit_session= len 25

# make comescore a static thing
reqrep ^(.*)/comscore-iframe/(.*) \1/static/comscore.html?path=\2


# make the iphone url pretty
reqirep ^GET\ /iphone/(.*) GET\ /static/iphone/\1

# make the socialite url pretty
reqirep ^GET\ /socialite/(.*) GET\ /static/socialite/\1

# make the redditaddict url pretty
reqirep ^GET\ /redditaddict/(.*) GET\ /static/redditaddict/\1

########
# button rewrites
reqirep ^GET\ /button\.js\ (.*) GET\ /static/button/button1.js\ \1
reqirep ^GET\ /button\.js\?t=([0-9])\ (.*) GET\ /static/button/button\1.js\ \2
reqirep ^GET\ /r/(.*)/button\.js\?t=([0-9])\ (.*) GET\ /static/button/button\2.js\ \3
reqirep ^GET\ /button\.js\?t=([0-9])&width=[0-9]+&height=[0-9]+\ (.*) GET\ /static/button/button\1.js\ \2

### acls

#ssl only to pay urls
acl sslrequest src 127.0.0.1
acl sslallowed path_beg /promoted
acl sslallowed path_beg /static
acl sslallowed path_beg /api

default_backend dynamic

backend dynamic
mode http
timeout connect 4000
timeout server 30000
timeout queue 60000
balance roundrobin
capture cookie reddit_session= len 25
option httpchk GET /health HTTP/1.1\r\nHost:\ reddit.local

server app01-8001 localhost:8001 maxconn 1 check fall 1
server app01-8002 localhost:8002 maxconn 1 check fall 1

listen stats 0.0.0.0:9000
mode http
balance
timeout client 5000
timeout connect 4000
timeout server 30000
stats uri /haproxy_stats

3 changes: 3 additions & 0 deletions srv/haproxy/log/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
umask 0027
exec setuidgid reddit multilog ./main
7 changes: 7 additions & 0 deletions srv/haproxy/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

ulimit -n 32768

cd ~reddit
exec 2>&1
exec /usr/sbin/haproxy -f /home/reddit/srv/haproxy/haproxy.conf
3 changes: 3 additions & 0 deletions srv/memcached/log/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
umask 0027
exec setuidgid reddit multilog ./main
4 changes: 4 additions & 0 deletions srv/memcached/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

exec 2>&1
exec /usr/bin/memcached -m512 -p11211 -U11211 -C -c10000 -u reddit -Bauto
3 changes: 3 additions & 0 deletions srv/reddit-app01/log/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
umask 0027
exec setuidgid reddit multilog ./main
5 changes: 5 additions & 0 deletions srv/reddit-app01/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

cd /home/reddit/reddit/r2
exec 2>&1
exec setuidgid reddit /usr/local/bin/paster serve run.ini http_port=8001
3 changes: 3 additions & 0 deletions srv/reddit-app02/log/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
umask 0027
exec setuidgid reddit multilog ./main
5 changes: 5 additions & 0 deletions srv/reddit-app02/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

cd /home/reddit/reddit/r2
exec 2>&1
exec setuidgid reddit /usr/local/bin/paster serve run.ini http_port=8002

0 comments on commit de2102e

Please sign in to comment.