Skip to content

qicst23/scalable-web-and-application-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scalable Web and Application Server

  1. Created an Apache Tomcat like web and application server in Java that could run Java servlets and render dynamic web pages.
  2. Tested on ApacheBench and successfully handled 50,000 requests with 1000 requests concurrently for images, style sheets, HTML pages, cookies and sessions.

Skills

Java, thread pool, servlet, HTTP 1.0/1.1, cookies, sessions

Course

Course: CIS555, Internet & Web Systems, Spring 2013

Deployment

The source files are located in src/edu/upenn/cis455/webserver folder. To compile the program, do

ant build

To start your server, in a terminal window run:

java -cp [jar files path rendered by ant build]
         [HttpServer class path] [port to listen for connection to ]
         [root directory of the static web pages]
         [the web.xml location for URL-class mapping]

For example:

java –cp target/WEB-INF/lib/hw1.jar:target/WEB-INF/lib/servlet-api.jar
        edu.upenn.cis455.webserver.HttpServer 8080
        /home/cis455/workspace/HW1
        /home/cis455/workspace/HW1/conf/web.xml

The server should be running now. Try openning firefox and typing:

http://localhost:8080/demo

It should take you to a page that says “Hello!”

Once you have this simple demo servlet working, you can try testing the other servlets that use cookies and sessions. For example, to test if you have your cookies working. try:

http://localhost:8080/cookie1

This will take you to a page where you can then click through the links to the cookie2 and cookie3 servlets.

To see how the server or thread pool works, go to Dispatcher.java then you will understand.

About

A high load-balancing and availability HTTP server like Apache Tomcat capable of running Java servlets and render dynamic web pages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors