Setting up Scalable LAMP Stacks for Business

Use of open source software was once limited to the geeks and techies of the IT world and generally avoided like the plague, by larger companies. Over the years, open source software has become significantly more secure and sophisticated, and it is rapidly gaining exposure across the entire business world, with larger companies making use of open source technologies.

The biggest four open source software applications have proved extremely useful when linked to cloud computing, namely cloud hosting. For example creating a cloud LAMP (Linux, Apache, MySQL and PHP) stack gives you a fantastic grounding when it comes to boosting the capabilities of your web-server and server stacks. In this article we take a look at the steps required in producing a LAMP stack for the process of managing a dynamic and secure database driven website.

Why set up a cloud LAMP stack in the first place?

So what is the main benefit of setting up a cloud based server over say a standard traditional server or rely on a web hosting company? By using cloud computing to create your server you are building in future growth and development without the need to go out and buy additional expensive hardware. From a strict efficiency perspective physical hardware would need to be configured each time that it was brought online, taking up your technical staff’s valuable time.

There are also additional cost considerations when it comes to physical servers where as cloud computing only requires payment for resource that is used up. Cloud computing ensures that servers are both quick and easy to upgrade giving you amply opportunity to expand your services.

So what about the software? A majority of cloud server companies offer a variety of Linux based operating systems on which to build your Apache, MySQL and PHP based linux virtual server. Clearly the first step to setting up a cloud LAMP stack is to choose a cloud hosting company and install a Linux based OS followed by both PHP and Apache.

Move MySQL database to a separate cloud database server

Now the true benefit of a cloud server is the fact that resources can be pulled in a variety of directions depending on requirements. In regards to web hosting this usually means splitting your front end services (the web pages and user facing information) from your back end services (e.g. database management, CMS systems etc). In order to spread the resources and move the back end away from the front end of the server; the MySQL database should be moved across to a separate cloud database server.

Making this move will enable your website to cope with heavier traffic demand, spreading the application resources between two separate servers. Again traditionally this might mean buying an entirely new server and wasting time on upgrade and maintenance. With a cloud server it’s extremely easy to set up and create servers on the fly due to visualization of the process.

You can then upgrade system resource again on the fly when you need it rather than buying resource in advance. Once you have a second server you simply need to need to prepare a MySQL server before setting up a private VLAN that will essentially communicate between your front end server and the back end/database server.

Once this has been done, you can then copy any databases that you have previously created over to the new cloud based server. Make sure that once you have done this, you have the correct permissions set up on the database that you have transferred. Once this is done, your site can be connected to the new database.

Create a second MySQL cloud database server for security

Whilst we always hope that our database server will not fail; to prevent costly failures, it is essential to set up a secondary MySQL cloud database in the event that the first one that you have created fails. It also allows additional potential expansion, should it be required.

Once this has been done, you will need to then copy over the database that you have previously created, to the new one. A ‘slave’ user will then need to be created in order to ensure that both servers have the ability to connect to the database. You will then need to configure and synchronise the servers to allow data transfer. This secondary server is essential to avoid any redundancy issues and to maintain service should your main database face any technicalities.

Add a second cloud web server with round robin DNS

As previously mentioned it is always useful to split your front end server from the database server. Having set up a second database cloud server you should create an additional front end server with round robin DNS replication so that each server has an equal load. This will provide additional security against the server becoming overloaded and is a standard practice of load distribution. When a DNS makes requests it is not only making them to one IP but to several associated IPs thus distributing resource requirements across several servers.

Add a front end Apache cloud load balancer

By adding an Apache front end load balancer, you are able to evenly distribute the traffic traveling between each of your servers. This cloud load balancer should be set up so that in the event of one of the servers failing, traffic is automatically switched over to the other.

Add a second cloud load balancer

To finish off the setting up of this cloud based server, you should then set up a second cloud load balancer. This balancer acts as a monitor to make sure that each node (or server instance) is still active. Provided that this is set up correctly, this ensures that the other server is set to become active the instant the first server fails.

Once you have finished the setting up of your scalable LAMP Stack; you should be left with a secure method of expanding your business without the need to purchase new and expensive hardware. Equally, you can be sure, provided that the LAMP stack is set up correctly, that should one of your servers fail at a critical time, the traffic will automatically switch to the secondary server, preventing loss of data and saving you an awful lot of valuable time.

 

ElasticHosts offer a wide range of linux based operating systems across a range of UK data centers making them a perfect choice for any cloud hosting requirements including UK cloud hosting.

Tags: , , , , , , ,

Comments are closed.