Web Servers
Web Servers
Application Administration
Web Servers
Shashikant S Kulkarni
1
Introduction
Web server
Responds to client requests by providing resources
Web server and client communicate with platform-
independent Hypertext Transfer Protocol (HTTP)
2
Web server architecture
3
How the WWW Works
4
Domain
Name
Server
System
5
HTTP Request Types
GET (default) and POST do basically the same thing:
Send data from the client to the server. However, they
have some differences:
GET
Appends form data directly to the end of the URL—visible to users
(not suitable for sending passwords)
Limited to 2,048 characters for the entire URL
Result page can be bookmarked and cached
POST
Sends form data in the HTTP request—invisible to users
Virtually no limit (but check your specific configuration)
Results are not cacheable or bookmarkable
6
System Architecture
Multi-tier application (n-tier application)
Information tier (data or bottom tier)
Maintains data for the application
Stores data in a relational database management system
(RDBMS)
Middle tier
Implements business logic and presentation logic
Control interactions between application clients and application
data
Client tier (top tier)
Application’s user interface
Users interact directly with the application through the client tier
7
N-tier Client-Server Architecture
9
Installing a web server
10
Hosting a website:
Self hosting
Install a web server on a computer
Local access
Using domain <localhost>
or IP address 127.0.0.1
Necessary for server-side programming development
Global access
Register a human-readable domain name
Obtain IP address
Static: Costs more
Dynamic: Needs dynamic DNS system, e.g.
http://www.dyndns.com/
11
Hosting a website:
Hosting service
Register a domain name
Assign name servers
Host takes care of IP addressing
Develop website locally
Upload website via FTP for global access
E.g. Filezilla
12
Web server architecture
LAMP: Most popular—fully open source
Linux for operating system
Apache for web server
MySQL for database
PHP for server-side scripting
Others:
WAMP: Uses Windows for operating system, with
Apache, MySQL, and PHP
WISA: Full Microsoft package
Windows
Internet Information Server (IIS)
SQL Server (enterprise) or Access (small-scale)
ASP or ASP.NET
13
Apache Web Server
Currently the most popular Web server
Stability
Efficiency
Portability
Open-source
14
All-in-one Apache/MySQL/PHP packages
EasyPHP
Includes PHPMyAdmin for administering MySQL
database
Installation and configuration
WAMP Server (recommended)
15
IIS Technologies
Introduction
Designed to deliver high speed and secure information
publishing
Scripting Languages
JavaScript, Jscript and VBScript
WAMP = Windows+Apache+MySql+PHP
Management Portals
PHPmyadmin
SQLitemanager
Configuration and
Settings
Loaded Modules
Directory Access
Shortcut
WAMP’s Menu
Services
Apache
MySQL
Note:
The icon tray
reflects the status
of your server.
Overall
WAMP is easy to install and it is free to use.
Migration from IIS/PHP/MsSQL to WAMP is
practical.
The cost of migration is mainly to review queries and
change them based on the SQL extension of
MySQL.
Apache Tomcat
35
The Apache Jakarta Project
The Apache Jakarta Project “creates and
maintains open source solutions on the Java
platform for distribution to the public at no
charge”
Apache Jakarta Tomcat--or just “Tomcat”--is one
of those projects
Tomcat is a container for Servlets
Tomcat can act as a simple standalone server for Web
applications that use HTML, Servlets, and JSP
Apache is an industrial-strength, highly optimized
server that can be extended with Tomcat
36
Web apps
A web application is basically a web site that:
“Knows who you are”--it doesn’t just give you static pages, it
interacts with you
Can permanently change data (such as in a database)
A web application can consist of multiple pieces
Static web pages (possibly containing forms)
Servlets
JSP
Tomcat organizes all these parts into a single directory
structure for each web application
...but you have to help with the organization
37
What is Apache Tomcat?
Apache is the most common HTTP Web Server on the
Internet.
The Tomcat server is a Java-based Web Application
container which is used to run Servlet and Java Server
Pages (JSP) Web applications.
Tomcat has become the reference implementation for
both the Java Servlets and Java Server Pages
specifications.
Tomcat was chosen to be the official Sun Web
Component (JSP/Servlet ) Container Reference
Implementation.
38
What is Apache Tomcat? [Contd.]
Apache Tomcat is used to serve Java Servlets and Java
Server Pages. It's a complex piece of software and
though the documentation is very comprehensive, it
helps to have a good reference work to hand.
It is an open source Java Servlet application server used
to deploy Java applications after they are built with JSP
and Servlets. It can be used as a stand-alone product or
it can be integrated with the Apache server.
39
Alternatives to Tomcat
Sun’s Java Web Server
Old, no longer being developed, all in Java
Java Web Server Development Kit (JWSDK)
Official reference implementation
Difficult to install and configure
JBoss
Open source
Opinions vary on how easy it is to install
Comes with built-in database
40