Servlet Configuration  «Prev  Next»

Lesson 8Testing and administering the Java Web Server
ObjectiveConfirm your installation of the Java Web Server.

Testing and Administering the Java Web Server

Once you have downloaded and installed the Java Web Server, it will be a good idea to use it to serve out some sample code, so you can be sure everything works properly.
Before the server can serve pages, it must be running. To start the server, you start an MS-DOS prompt and change to the folder where you installed the server. From there change to that folder’s bin directory and enter this command:
httpd

Caution

Do not close this MS-DOS prompt, or sign off and sign on as another user, until you have shutdown the server as described in the next lesson. You will leave your system unstable if you do.
  1. This starts the server.
  2. (UNIX users type the same command, from the bin subdirectory of the directory where you installed the JWS.)
  3. You are then free to test the server by launching a browser and entering a URL.
  4. Any URL that starts http://localhost:8080 will be handled by the Java Web Server.
Below is an example of a page being served from the JWS to a browser:

Tomcat it Works
Tomcat Success Page


To change any settings on your Web server, or to shut it down, you will need to use the Web-based administration tool. Enter the following URL:
http://localhost:8080/

When you are asked to log in, use admin for the User Name and admin for the password, then click Log In. On the administration page, click Web Service to highlight it, then click the Shut Down button. This will stop the Web server properly, and at this point you can close the MS-DOS prompt from which you started it, if you wish. When you wish to start the Web server again, use the httpd command as described in the previous lesson.

Caution

If your computer is directly connected to the Internet, use this tool to change your administration port from 8080, and your User Name and Password from these defaults. Anyone who has seen the documentation for the JWS could try to control your server using the defaults. If you connect through a firewall, only connect occasionally, or do not leave any important information on the Web server, you can leave the default values in place.
All the configuration and administration of the Java Web Server is done through this URL. You will be seeing more of this screen later in the course.
In the next lesson, you will learn about some other Web servers that support servlets.

Testing - administering WebServer- Exercise

Configure the Java Web Server.
Testing Administering WebServer - Exercise