I am going to purchase a VPS and install a Ruby on Rails application with Puma as web server on Ubuntu 16.04
My hosting provider does not offer DDoS protection, so I started to look for open source free to use solutions, and found a useful documentation which also contains HAProxy.
I started to read HAProxy documentation and realized that it is a complex piece of software which functions primarily as load balancer. This might come in handy, however, before proceeding, I would like to be sure if it suits me.
As I said, I was primarily focused on finding DDoS protection, so I would appreciate any suggestion on how to configure HAProxy for this purpose, if any configuration is necessary.
Also, I would need it on a single, stand alone server, serving the same machine on which it is installed. I found many tutorials, at DigitalOcean as elsewhere (at server-world for instance): all of them seem to assume that the machine where HAProxy is installed should only function as frontend for other backend servers. I wonder if HAProxy can be useful if frontend and backend are represented by a single server/machine.
Since I would be using HAProxy on a Ubuntu machine, I wonder if the deb packages come with a logrotate file, if the recommended socat, halog, tcpdump, strace packages are installed with HAProxy or should be installed separately, if HAProxy works in conjunction with iptables or other firewalls, how can I make HAProxy listen to both 80 and 443 ports, if it is possible to use sendmail/mailx to send email alerts…