Apache load balancing and failover

October 5, 2012 in Web Server

Apache load balancing and failover with pound

What is server load balancing?

Load balancing is a way to split all the income requests, to more than 2 servers. You must have a load balancing when you have a lot of income requests that a server can not handle. If you have for example a web site with a lot of visitors that a single server will not be able to handle, you must split the traffic to 2 or more web servers.  In this tutorial i will use 2 web servers and a load balancing server to redirect the http request.

What is server failover?

If you have a web site in a web server and you want for example to close this server for maintenance reasons or if your server due to a technical reason stop operating, your website will be offline until you fix this problem! Fail over is a way to automatically redirect the incoming requests for your website to another web server.

In this tutorial you will find an easy way to load balancing and failover using pound. Pound is an open source reverse proxy that can handle load balancing and failover with a strong emphasis in security.

Lets say that you have a static ip (i will use a non-existing IP 145.47.82.256), a domain name (allaboutlinux.eu) for your website, a webserver (with internal IP 192.168.0.250) and a router (configured to redirect all the incoming requests for port 80 to 192.168.0.250). If you have all the above its easy to create a public website hosted on your webserver. But this server has no failover or load balancing since its a single server.

 

If you need failover and load balancing you will need one more server with a replica of your website and a server that will handle the load balancing and fail over. Lets start creating the Pound server!

How to Host multiple Websites on Apache2

March 29, 2012 in Apache Configuration

How to Host multiple Websites on Apache2

Let’s say that we own 2 or more domain names (hostpage1.com and hostpage2.com). We also have 2 web pages (hostpage1 and hostpage2). But we have only 1 webserver and 1 public IP (for this example i will use local IP but it will be the same if you own a public static IP)

Setting up the Domain names.

First thing is to create an “A record” in the DNS of your Domain Names to point “www” to your public or local IP address of your Web Server. I use local DNS in this example. So i will point the “www” for both of my domain names to 192.168.0.31. So it will be something like that:

www.hostpage1.com –> 192.168.0.31

www.hostpage2.com –> 192.168.0.31

Read the rest of this entry →

Install Apache web server in Ubuntu

February 15, 2012 in Apache

Install Apache web server in Ubuntu / Debian

What is apache?

Apache is the most popular web server on the internet. It is highly configurable with third party modules, can run under several Operating Systems including Ubuntu and its very secure and stable. That is why more than 50% of websites currently running on the internet have an Apache server behind them.

How to install Apache on Ubuntu 11.04

You can install Apache2 from the Terminal by using:

$> sudo apt-get install apache2

when the installation is finished Apache is up and running and you can test that by point your web browser to http://localhost/

Read the rest of this entry →