i’m embarking upon a big server migration moving from a “co-lo” to cloud-based VPS hosted solution. the cloud provider i’m going with is linode. my first attempt at launching an instance of a VM failed and i had to contact their customer support.
their online customer support migrated me from one box to another and i was up and running quickly thereafter. the CS rep responded to my online support ticket within 30 minutes of opening it, so that seemed pretty good.
so far, i’m pretty impressed with linode. all of the pain of being a sysadmin, however, is coming back to me and what’s worse is that i’ve decided that i really want to complicate the architecture of my little box…because i can.
this box largely is responsible for hosting several wordpress blogs, but it’s also home to some personal projects. most of the legacy stuff is all LAMP-based so once i get wordpress working, everything else should hopefully fall into place.
the one wrinkle in this is that i really want a good playground with some node.js projects i have in the background. i’ve decided to reverse proxy all requests coming into this box with haproxy. nginx is so much simpler to setup for this kind of straightforward proxying, but i really love the admin stats that haproxy provides.
haproxy is working great now, it always takes me a while to fiddle with it before i get it just right:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
global log 127.0.0.1 local0 notice chroot /var/lib/haproxy user haproxy group haproxy daemon defaults log global mode http option httplog option dontlognull option forwardfor contimeout 5000 clitimeout 50000 srvtimeout 50000 errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http frontend localnodes bind *:80 mode http # ACLs acl nodejs path_reg ^/node/?.*$ use_backend node if nodejs default_backend apache backend apache server web1 127.0.0.1:8080 check backend node server web1 127.0.0.1:8081/node check listen admin bind *:8888 mode http stats enable stats uri /haproxy?stats stats realm Strictly\ Private stats auth username:password |
we’ll call it a day there.