Chapter 1 Web Server Setup and Configuration
Contents A.What is web server B.Installing and Configuring Web Server C.Testing the Installation
A. What is the web server The most common use of web servers is to host website, but there are other uses such as gaming, data storage, running enterprise applications, handling , FTP, or other web uses.gamingenterprise applications FTP The primary function of a web server is to store, process and deliver web pages to clientsweb pagesclients A user agent, commonly a web browser or web crawler, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource or an error message if unable to do so.user agentweb browserweb crawlerrequesterror message
A. What is the web server The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP)Hypertext Transfer Protocol (HTTP) Pages delivered are most frequently HTML documents, which may include images, style sheets and scripts in addition to text content. HTML documents imagesstyle sheetsscripts
Architecture
Some of popular web server Apache Tomcat Apache HTTP Server Microsoft IIS Server IMB Lotus Server Lighttpd Macromedia JRun, and Caucho Resin
B. Installing and Configuring Web Server 1.Installing Java 2.Installing Tomcat Web Server 3.Configuring Tomcat
1. Installing Java Download JDK at vase/downloads/index.html and run it
2. Installing Tomcat Web Server Download tomcat Web Server at and run it Destination folder: C:\Program Files\Apache Software Foundation\Tomcat 8.0 (TOMCAT_DIR)
Port number: 7777
3. Configuring Tomcat Configuration file: TOMCAT_DIR/conf/server.xml 3.1. Specifying Server Port 3.2. Hosting a website 3.3. Manage tomcat user 3.4. Deploy war file
3.1. Specifying Server Port Change port from 7777 to 7878
3.2 Hosting web site
3.3. Manage tomcat user Open the configuration file TOMCAT_DIR/conf/tomcat-users.xml
3.4 Deploy web application (war file)
B. Testing the Installation 1. Starting Netbean IDE Create Web Application project “HelloTomcatApp” for testing: 2.1 Testing HTML 2.2 Testing JSP 2.3 Testing Servlet
1. Starting NetBean 8.0
2.1 Testing HTML Create hello.html to testing tomcat web server with html file
Using Firefox browser to access to hello.html
2.2. Testing JSP Create helloJSP.jsp in the “Web Pages” location to test JSP format
Using Firefox browser to access to helloJSP.jsp
2.3 Testing Servlet Create HelloServlet.java in the “Source Packages” location to test Servlet format
Running HelloServlet Using Firefox browser to access to helloServlet
References 1.Core Servlets And Java Server Pages, Volume 1, 2 nd Edition, Chapter 02.
Revision History