To create a simple implementation of a web server. This webserver should be able to serve simple static content such as an html page with images css and js

已关闭 已发布的 Mar 27, 2014 货到付款
已关闭 货到付款

Configuration:

Configuration should be read from a file. Location of the file should be read as a command line argument. In case file is not specified as command line argument, default file should be read. If no file is specified as command line argument and default file is not found, server should log and print an error and exit.

Configuration file consists of tab separated key value pairs of configuration values. Following keys should be supported

Port

DocumentRoot

IPBlackList

# Specifies the port number that the server should bind to

# Specifies the root directory of documents to be served by the webserver

# Specifies the list of IP addresses that should not be served. Note that this can # be a whole block specified using * wildcard. E.g. 122.56.* will block all IP

# addresses beginning with 122.56

Port and DocumentRoot are required configuration values. IPBlackList is optional.

Configuration keys are not case-sensitive however configuration values may be case sensitive.

Concurrency:

At a time, only one server should be running on a machine. The server itself may use threading to serve several requests in parallel.

If a server is already running and an attempt is made to launch another instance, the new launch should be aborted with appropriate error message. Same should be logged.

Logging:

Sever should log all page requests and their status. Here is a sample log entry for the same 3 Mar 14 12:36 PM : 200 : Page /site/trisect/[url removed, login to view] requested by [url removed, login to view] <Date> <Time> : <HTTP Status> : <Request details including IP>

All exceptions encountered should be logged as well along with the timestamp.

Content Structure:

Content will be stored in a directory hierarchy under DocumentRoot directory. To access the content inside a directory, URL will contain the same path. E.g. to access



<DocumentRoot>/sites/trisect/[url removed, login to view] on a server running on IP [url removed, login to view], request URL will be http:// [url removed, login to view]

Note that URL after the IP address is the same as path of the file inside the DocumentRoot Webserver should be able to serve static content – at least html pages with css and js.

In case specified file is not found, 404 should be returned to the client.

Request and Response Format:

Server should use HTTP 1.1 request response format. Simplest way to test your server is to hit it using your browser.

Java

项目ID: #5724681

关于项目

6个方案 远程项目 活跃的May 3, 2014

有6名威客正在参与此工作的竞标,均价₹14083/小时

samr14

I have worked on very similar project it was very basic. It listens on configured port number and returns the pages specified by the url. I have already modified it to accept port number and root dir as params. It work 更多

₹12000 INR 在4天内
(1条评论)
2.0
stonechow

一个有效的提议尚未被提供

₹27777 INR 在7天内
(0条评论)
0.0
thamizhmalar

I have strong knowledge in java and web application development. Having ability to learn things quickly. Interested to work with you and also assure you that my work will be delivered on time with quality.

₹11111 INR 在7天内
(0条评论)
0.0
saasira

Dear Yogesh, I worked with several multi national companies for over eight years and just started freelancing; so you can be rest assured of timely delivery and the quality of work i deliver. Coming to the task a 更多

₹11111 INR 在3天内
(0条评论)
0.0