Running Your Own Cloud Server
Cloud hosting is growing. Once just considered a buzz word, the importance of cloud servers and cloud computing in business and public sector IT infrastructure is not only growing but the practice is becoming integral in the decision process for IT departments. However, whilst the practice of running a dedicated physical server is an established skill set in any proficient IT department, there are still questions around the processes behind cloud server management.
Running a cloud server has many advantages over traditional physical servers – but what is a cloud server? Simply put a cloud server is a virtualised server environment that is considered fully flexible in terms of resource allocation. This offers several benefits:
1) Data can easily be replicated onto several identical web servers to ensure server redundancy in an extremely fluid manner.
2) Virtualised resources enable users to scale resource requirements instantly leading to creator cost efficiencies. This is extremely effective for scaling with the business and integral for ensuring efficiencies for businesses such as start ups.
In truth the management of a cloud server is effectively the same as any physical server. Security issues relating to server intrusions are controlled by access to the main virtual server much like any physical or dedicated server. From a security perspective virtualised cloud hosting does enable protection against hardware failure and when paired with redundancy measures can enable data and servers to essentially be copied exactly and set live in the event of any failure. The main advantage that cloud servers tend to have over physical servers is the fact that the creation of server instances is done through easy to use control panels and APIs provided by the cloud server host/company. This effectively means little reliance on hardware management but more control over the actual resources. Essentially anyone can create a server instance in a cloud environment.
This potentially gives IT departments more time to reflect on the software requirements for the server. A popular approach to many web hosts is the use of the LAMP server environment. LAMP covers the primary components of dynamic website management through Linux (the operating system), Apache (the server type), MySQL (the database), and PHP (script based language). From a website perspective LAMP is prolific because of ease and widespread use of the approach across a variety of websites coupled with the fact that the environment is open source and effectively free.
Clearly for start ups who might not be able to invest in an IT team but would like to dabble in the world of server management, cloud servers would appear to be very tempting (especially as a learning curve). To demonstrate how easy it would be to set up a LAMP environment a cloud server we’ve listed the steps below. There are plenty of free cloud server trials in which you can test the below procedure so make sure you sign up to one of your favourite. Follow the company’s specific steps in setting up an instance – we’ll be using Ubuntu (see this tutorial for how to set up a cloud server).
Step 1 – Create a Cloud Server
After creating your cloud server boot up and access the virtual server using the appropriate logins. Use a VNC (such as TightVNC) to access the server.
Step 2 – Install PHP & Apache
So you are logged in and should be seeing a terminal screen. Good! Time to install PHP and Apache…
Type the following into the terminal screen:
$ apt-get update
$ apt-get dist-upgrade
$ apt-get install apache2 php5 libapache2-mod-php5
Essentially all this is saying to the Ubuntu OS is look at the repositories, update and find the Apache and PHP installation packages and install them.
When done, go to the browser and enter your virtual server’s IP (something like http://xx.xxx.xxx.xxx) which can usually be found in the control panel for your virtual server. The Apache ‘It works!’ page – the default web page for the server should be now be visible! So with LAP effectively installed the next stage is to test PHP & install MySQL…
Step 3 – set up PHP page
Type the following in the terminal screen:
$ mkdir /var/www/test $ echo “<?php phpinfo(); ?>” > /var/www/test/index.php $ chmod a+x /var/www/test/index.php $ /etc/init.d/apache2 restart
What this is doing is navigating to the directory for your new server (and creating a new directory called “test”), creating a page called index.php and inserting the PHP code, making the index.php writable/readable and then restarting the server. When done, go to browser http://xx.xxx.xxx.xxx/test
On successful completion, the PHP setup information will be displayed indicating that Apache and PHP are both up and running beautifully.
Step 4 – Install MySQL and build a basic database
Type the following into the terminal:
$ apt-get install mysql-server mysql-client php5-mysql
Like before this essentially tells Ubuntu to look at the repositories, get the mysql package and install the latest (php5).
You’ll be asked to set the root password for MySQL – make it secure as this is a public facing server. Leave Apache as chosen server…
Next access the MySQL server to create the database and create a new user.
$ mysql -u root -p > CREATE DATABASE sales; > CREATE USER ‘seller’ IDENTIFIED BY ‘sellpass01′; > GRANT ALL PRIVILEGES ON sales.* to ‘seller’;
Insert business specific data or use some sample basic data for trial purposes to create the database, for example car sales
> USE sales; > CREATE TABLE cars (name VARCHAR(100), price DOUBLE); > INSERT INTO cars VALUES (‘ford’, 21333); > INSERT INTO cars VALUES (‘kia’, 42333); > INSERT INTO cars VALUES (‘cooper’, 80111); > exit;
When done, make a PHP page that will connect to the database and display information.
$ cd /var/www
$ vi index.php
This essentially navigates to the main server directory and opens up a new page called “index.php”. Using vi (standard text editor on Ubuntu) you can edit the contents of this directory index file:
<?php
// connect to the database
$con = mysql_connect(‘localhost’,'seller’,'sellpass01′)
or die(‘Could not connect to the server!’);
// select a database:
mysql_select_db(‘sales’)
or die(‘Could not select a database.’);
// build query:
$sql = “SELECT name, price FROM cars”;
// execute query:
$result = mysql_query($sql)
or die(‘A error occurred: ‘ . mysql_error());
// get result count:
$count = mysql_num_rows($result);
print “<h3>$count car sales available</h3>”;
print “<table>”;
print “<tr><th>Name</th><th>Total Sales (USD)</th></tr>”;
// fetch results:
while ($row = mysql_fetch_assoc($result)) {
$name = $row['name'];
$price = $row['price'];
print “<tr><td><strong>$name</strong></td><td>$price</td></tr>”;
}
print “</table>”;
?>
Go to http://xx.xxx.xxx.xxx to see a display of the MySQL data
And there is it – a free flowing LAMP server environment that is extremely easy to create, scale and manage.
This article has been created on behalf of ElasticHosts – a leading cloud server company. Find out more about ElasticHosts’ full range of services including UK & US cloud hosting.
Latest posts by DST Contributor (see all)
- Guidelines for Enhancing Social Media Sharing - June 17, 2013
- Is Search Engine Optimization Growing Faster In New York Than The Rest Of The Country? - June 12, 2013
- SEO Campaign Management: Top 3 Requirements - June 5, 2013
One Response to “Running Your Own Cloud Server”






I’ve just discovered the new SEO too-it’s Colibri and it’s awesome-it can track my website position on every Google,it also find my competition or even suggest it, monitors Facebook, Twitter mentions and backlinks to my website.Most functional-highly recommend!http://colibritool.com/