{"id":257,"date":"2010-01-22T00:00:00","date_gmt":"2010-01-22T00:00:00","guid":{"rendered":"http:\/\/blog.trungson.com\/?p=257"},"modified":"2010-01-22T00:00:00","modified_gmt":"2010-01-22T00:00:00","slug":"haproxy-and-stunnel","status":"publish","type":"post","link":"http:\/\/blog.trungson.com\/?p=257","title":{"rendered":"haproxy and stunnel"},"content":{"rendered":"<p>This quick reference to install haproxy, stunnel to support SSL forwarding (with IP forwarding patch)<\/p>\n<pre>\nwget http:\/\/haproxy.1wt.eu\/download\/1.3\/src\/haproxy-1.3.22.tar.gz\ntar -zxf haproxy-1.3.22.tar.gz\ncd haproxy-1.3.22\nmake TARGET=linux26\ncp haproxy \/usr\/sbin\/haproxy\nvi \/etc\/haproxy.cfg\n...\nvi \/etc\/init.d\/haproxy\n...\nchmod +x \/etc\/init.d\/haproxy \n\nuseradd haproxy \nmkdir -p \/var\/chroot\/haproxy \nchown haproxy:haproxy \/var\/chroot\/haproxy \nchmod 700 \/var\/chroot\/haproxy\n\nservice haproxy start\nchkconfig --add haproxy \n\nvi \/etc\/sysconfig\/syslog\nSYSLOGD_OPTIONS=\u201d-m 0 -r\u201d\n\nvi \/etc\/syslog.conf\nlocal0.* \/var\/log\/haproxy.log\nlocal1.* \/var\/log\/haproxy-1.log\n<\/pre>\n<h4>Stunnel with HAProxy patch<\/h4>\n<pre>\nyum remove stunnel\nyum install openssl-devel openssl\n\nwget http:\/\/www.stunnel.org\/download\/stunnel\/src\/stunnel-4.22.tar.gz\ntar -xzf stunnel-4.22.tar.gz\n\ncd stunnel-4.22\nwget http:\/\/haproxy.1wt.eu\/download\/patches\/stunnel-4.22-xforwarded-for.diff\npatch -p1 < stunnel-4.22-xforwarded-for.diff\n\n.\/configure --disable-fips\nmake\nmake install\nmkdir -p \/etc\/stunnel\nvi \/etc\/stunnel\/stunnel.conf\n....\nvi \/etc\/init.d\/stunnel\n....\nvi \/etc\/stunnel\/your.pem\n....\nln -s \/usr\/local\/bin\/stunnel \/usr\/sbin\/stunnel\nchmod +x \/etc\/init.d\/stunnel\nservice stunnel start\nchkconfig --add stunnel \n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This quick reference to install haproxy, stunnel to support SSL forwarding (with IP forwarding patch) wget http:\/\/haproxy.1wt.eu\/download\/1.3\/src\/haproxy-1.3.22.tar.gz tar -zxf haproxy-1.3.22.tar.gz cd haproxy-1.3.22 make TARGET=linux26 cp haproxy \/usr\/sbin\/haproxy vi \/etc\/haproxy.cfg &#8230; vi \/etc\/init.d\/haproxy &#8230; chmod +x \/etc\/init.d\/haproxy useradd haproxy mkdir -p \/var\/chroot\/haproxy chown haproxy:haproxy \/var\/chroot\/haproxy chmod 700 \/var\/chroot\/haproxy service haproxy start chkconfig &#8211;add haproxy vi \/etc\/sysconfig\/syslog [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/257"}],"collection":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257"}],"version-history":[{"count":0,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}