Click here to documentation.

advertisement
Ajith Chandran
Distributed Web-server Systems
Introduction
Web based system is used to deploy web applications. This allows client to access applications from
remote location with the help of web browsers. Usually these webservers run on one main server which
has web server and database server installed in it.
Need for distributed web-server system
The issue with such single server based web system architecture is that, if for any reasons the server
goes down, the users will get interrupted and the browsing session will be destroyed.
Distributed web-server architecture
Below shown is distributed web-server architecture. Here we are using multiple webservers through a
load balancer. Each webserver is communicating with database server. Why we are using multiple
webservers is that, even if one of the server goes down the pages will be served from the next available
server without interrupting the client continuity and browsing sessions.
What I did in this project?
I have setup this distributed web server system architecture in my local machine. I have also demoed
this during my project demonstration. For setting up this architecture I have made use of VirtualBox.
CS524 Project: Distributed Web-Server Systems
1
Ajith Chandran
How I Implement this architecture in my Local Machine?
I have created four different instance of Linux CentOS 6.4 Operating System in my machine. For this I
have made use of VirtualBox. Each machine is configured as follows:
1. Configured all the Linux instances to obtain static IPs.
2. Installed all updates for developer tools.
3. Configured iptables to open specific ports.
Configuring Load Balancer Server (Server 1):
1. Installed apache webserver.
2. Disable ProxyRequests from Apache
3. Configured Apaches configuration file (/etc/httpd/conf/httpd.conf)
4. I have used "byrequest" balancing algorithm which is the same as a Round Robin, so for each
new request you will get a new webhead.
5. ProxyPass in apache is configured.
Configuring web-server 1 and web-server 2
1. Installed Apache
2. Installed latest version of PHP
3. Installed pecl and perl
4. Configured php max_execution_time and memory_limit
5. Loaded php as CGI into Apache
6. Deployed the web application to both server.
7. Configured the application to access data from database server.
Configuring Database server
1. Installed MySQL
2. Configured MySQL
3. Created Database and tables required for running my application.
4. Added access rules so that application deployed from Web-Server 1 and 2 are allowed to
communicate with MySQL.
Application to test the architecture implemented
In order to test the distributed web server systems architecture implemented using VirtualBox, I have
created a simple php application that can be deployed to the webserver. This application makes use of
database server for all SQL queries.
Working of the application
In the application screen shot shown below, there are 2 sections marked. They are as follows:
Section 1: This area allows a user to add or edit user name or password. Enter new username and
password and click submit button to save it to database. Reset button to discard and changes made
while editing an existing data.
CS524 Project: Distributed Web-Server Systems
2
Ajith Chandran
Secrion2: This area lists all the username and password currently added to the database. Delete link
shown along with each record allows deleting that particular record. Edit link allows editing a record. On
clicking edit link corresponding record will be loaded into Section 1. After modifying the data click
submit button to save the change.
Installing application
To install the application on new server follow the steps:
1. Unzip the application folder to “htdocs” of apache. Usually in Linux this folder will be
“/var/www/html/”.
2. You will see a new folder “DSProject” in this folder.
3. Import the sql file “databasebackup.sql” from this folder to MySQL database server.
4. Now configure your Database hostname, username, and password from the file “conn.php”.
5. Once this is done in your browser navigate to http://<HOSTNAME>/DSProject/
6. <HOSTNAME> is the IP address of your machine.
Conclusion
In my project I was able to setup the architecture explained in this document. And installed above
mentioned web application and tested successfully the working of this architecture. I was able to make
continue browsing even with one of the webservers turned off.
CS524 Project: Distributed Web-Server Systems
3
Download