Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
16
Chapter 1 Overview of Servlets and JavaServer Pages
Configure the Server
Before you start the server, you may want to designate parameters like the
port on which it listens, the directories in which it looks for HTML files, and
so forth. This process is totally server specific, and for commercial quality
Web servers should be clearly documented in the installation notes. How 
ever, with the small stand alone servers that Apache and Sun provide as ref 
erence implementations of the servlet 2.2/JSP 1.1 specs (Apache Tomcat) or
2.1/1.0 specs (Sun JSWDK), there are a number of important but poorly doc 
umented settings that I'll describe here.
Port Number
Tomcat and the JSWDK both use a nonstandard port by default in order to
utorial/
avoid conflicts with existing Web servers. If you use one of these products for
vailble at 
initial development and testing, and don't have another Web server running,
cat T
you will probably find it convenient to switch to 80, the standard HTTP port
om
number. With Tomcat 3.0, do so by editing 
install_dir/server.xml
,
changing 8080 to 80 in the line 
omcat are a /Apache T
or T
With the JSWDK 1.0.1, edit the 
install_dir/webserver.xml
 file and
tions f
replace 8080 with 80 in the line 
rec
port NMTOKEN "8080"
The Java Web Server 2.0 also uses a non standard port. To change it, use
.coreservlets.com
the remote administration interface, available by visiting 
http://some 
hostname:9090/
, where 
somehostname
 is replaced by either the real name
: Updated di
TE
of the host running the server or by 
localhost
 if the server is running on the
NO http://www
local machine.
JAVA_HOME Setting
If you use JDK 1.2 or 1.3 with Tomcat or the JSWDK, you must set the
JAVA_HOME
 environment variable to refer to the JDK installation directory.
This setting is unnecessary with JDK 1.1. The easiest way to specify this vari 
able is to insert a line that sets it into the top of the 
startup
 (Tomcat) or
startserver
 (JSWDK) script. For example, here's the top of the modified
version of 
startup.bat
 and 
startserver.bat
 that I use:
rem Marty Hall: added JAVA_HOME setting below
set JAVA_HOME=C:\jdk1.2.2
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved