install and configure haproxy, the software based loadbalancer in Ubuntu

HAProxy is a very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It’s free and open source application which is very lightweight as well. I checked few other alternatives like perlbal, pond etc. but found haproxy most competent performer.

I’m describing here the steps I followed to download, install and configure it in Ubuntu Server. We have 2 backend Web servers which will receive traffic from Load balancer host running HAProxy in front of them.

Step 1. Download, compile and install HAproxy from here :

$ cd /usr/src
$ wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.11.tar.gz
$ tar xzf haproxy-1.4.11.tar.gz 
$ cd haproxy-1.4.11
$ make install

Quickly disable ssh version 1 in Linux

This is going to be very short post :)

SSH v1 is not very safe and if you are looking to pass your site/server for PCI compliance then you must disable it. Don’t worry it is too easy to do.
Open /etc/ssh/sshd_config file and disable version 1:

$ vi /etc/ssh/sshd_config

find line: #Protocol 2,1 and remove 1 from it and then un-comment it, the final line should look like this:

$ cat /etc/ssh/sshd_config | grep Protocol
Protocol 2

Restart SSH service to apply changes.

$ service sshd restart

5 steps to secure your Linux server

How would you ensure security of your production Linux Server? Should you can be happy with default configuration there in place or there’s are things which we must implement for enhancing security aspects? Of course, Yes. Here I’m writing 5 steps which I usually take to tighten security in Server. This doesn’t means these are Best thing you can do or You don’t need to do anything else. There are many ways and remember securing your Server is a never ending process, So keep an eye open and check your Server regularly.

Quickly install Java, Ant, Ivy and Red5 Flash server in Linux

Although the Red5 installation guide is there and simple but they only explained how to install it in Ubuntu. I am documenting here the steps I took to install it in CentOS 5.4 server and worked like charm. It should be more or less similar in any Redhat based distro.

Step 1. Install openjdk through yum:

$ yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel

Step 2. Download the binary version of ant. I got it from here:

$ cd /usr/src 
$ wget  http://apache.opensourceresources.org//ant/binaries/apache-ant-1.8.2-bin.tar.gz
$ tar xzf apache-ant-1.8.2-bin.tar.gz
$ cd apache-ant-1.8.2

Step 3. After inflating the compressed file, you will get all binary contents of ant. You can now copy/move bin and lib directories to any location to access ant. I’m creating a directory here and copying these directories there.

Beware about admin commands in MySQL replication

Here is the situation: We are doing replication of only 1 table from a database (live) to other host (backup). so we expect that updates which are on others DBs/tables except on this table should not replicate. Wrong! they got replicated.

We shifted one DB say DB1 from live env to Backup DB host and then removed that DB1 from Live. Even replication was only for a single table of a particular DB say DB5, DB1 got removed from Backup host as well, living us in vaccum :P