Running The Tomcat 4.0 Servlet/JSP Container ( part translated by sonymusic)(1分)

  • 主题发起人 主题发起人 曹晓钢
  • 开始时间 开始时间

曹晓钢

Unregistered / Unconfirmed
GUEST, unregistred user!
Running The Tomcat 4.0(英文,关键部分译成了中文。)
sonymusic 发表于 1/15/2002 2:21:38 PM Java程序设计 ←返回版面

Running The Tomcat 4.0 Servlet/JSP Container
============================================
This subproject contains Tomcat 4.0, a server that implements the Servlet 2.3
and JSP 1.2 Specifications from Java Software. In order to install and run
this container, you mustdo
the following:
怎么要让tomcat跑起来呢?
(0)do
wnload and Install a Java Development Kit
下载安装jdk,并设置java_home
*do
wnload a Java Development Kit (JDK) release (version 1.2 or later) from:
http://java.sun.com/j2se/
* Install the JDK according to the instructions included with the release.
* Set an environment variable JAVA_HOME to the pathname of the directory
into which you installed the JDK release.

(1)do
wnload and Install the Tomcat 4.0 Binary Distribution
下载tomcat4,并解到某一目录下,设置CATALINA_HOME 为tomcat的目录。
NOTE: As an alternative todo
wnloading a binary distribution, you can create
your own from the Tomcat source repository, as described in "BUILDING.txt".
If youdo
this, the value to use for "${catalina.home}" will be the "dist"
subdirectory of your source distribution.
*do
wnload a binary distribution of Tomcat from:
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/nightly/
On a Windows platform, you will need:
jakarta-tomcat-4.0-YYYYMMDD.zip
On a Unix platform, you will need:
jakarta-tomcat-4.0-YYYYMMDD.zip
* Unpack the binary distribution into a convenient location so that the
distribution resides in its own directory (conventionally named
"jakarta-tomcat-4.0"). For the purposes of the remainder of thisdo
cument,
the symbolic name "${catalina.home}" is used to refer to the full
pathname of the release directory.

(2) Start Up Tomcat 4.0
There are two techniques by which Tomcat 4.0 can be started:
* Via an environment variable:
- Set an environment variable CATALINA_HOME to the path of the directory
into which you have installed Tomcat 4.0.
- Execute the shell command:
根据不同的操作系统执行不同的命令来启动tomcat
%CATALINA_HOME%/bin/startup (Windows)
$CATALINA_HOME/bin/startup.sh (Unix)
* By modifying your current working directory:
- Execute the following shell commands:
cd %CATALINA_HOME%/bin (Windows)
startup (Windows)
cd $CATALINA_HOME/bin (Unix)
./startup.sh (Unix)
After startup, the default web applications included with Tomcat 4.0 will be
available by browsing:
好啦,现在可以访问tomcat了。
http://localhost:8080/
Further information about configuring and running Tomcat 4.0 can be found in
thedo
cumentation included here, as well as on the Tomcat web site:
http://jakarta.apache.org/tomcat/

(3) Shutdo
wn Tomcat 4.0
There are two techniques by which Tomcat 4.0 can be stopped:
* Via an environment variable:
- Set an environment variable CATALINA_HOME to the path of the directory
into which you have installed Tomcat 4.0.
- Execute the shell command:
根据不同的操作系统执行不同的命令来启动tomcat
%CATALINA_HOME%/bin/shutdown (Windows)
$CATALINA_HOME/bin/shutdown.sh (Unix)
* By modifying your current working directory:
- Execute the following shell commands:
cd %CATALINA_HOME%/bin (Windows)
shutdown (Windows)
cd $CATALINA_HOME/bin (Unix)
./shutdown.sh (Unix)

(4) Advanced Configuration - Multiple Tomcat 4 Instances
这部分一开始就不要看啦。
In many circumstances, it is desireable to have a single copy of a Tomcat 4
binary distribution shared among multiple users on the same server. To make
this possible, you must configure a CATALINA_BASE environment variable (in
addition to CATALINA_HOME as described above) that points to a directory
that is unique to your instance.
When youdo
this, Tomcat 4 will calculate all relative references for files in
the following directories based on the value for CATALINA_BASE instead of
CATALINA_HOME:
配置目录
* conf - Server configuration files (including server.xml)
日志
* logs - Log and output files
你的应用一般就放在这个目录
* webapps - Automatically loaded web applications
这是工具目录,JSP编译后的临时文件所在
* work - Temporary working directories for web applications
If youdo
not set CATALINA_BASE to an explicit value, it will be initialized
to the same value as is set for CATALINA_HOME (which means that the same
directory is used for all relative path resoluations).

(5) Troubleshooting:
常见问题
There are only really 3 things that can go wrong during the stand-alone
Tomcat 4.0 install:
8080端口被别的程序如webserver占用啦。
1) The most common hiccup is when another web server (or any process for that
matter) has laid claim to port 8080. This is the default HTTP port that
Tomcat attempts to bind to at startup. To change this, open the file:
$CATALINA_HOME/conf/server.xml

...and search for '8080'. Change it to a port that isn't in use, and is
greater than 1024, as ports less than or equal to 1024 require superuser
access to bind to.

Restart Tomcat and you're in business. Be sure that you replace the "8080"
in the URL you're using to access Tomcat. For example, if you change the
port to 1977, you would request the URL http://localhost:1977/.
该死的98下才会出的问题
2) An "out of environment space" error when running the batch files in
Win9X/ME-based operating systems.
右击startup.bat和shutdown.bat文件,属性->memory,初始内存中输入4096。
Right-click on the STARTUP.BAT and SHUTDOWN.BAT files. Click on
"Properties" then
on the "Memory" tab. For the "Initial environment" field,
enter in something like 4096.

After you click apply, Windows will create shortcuts in the directory with
which you can use to start and stop the container.
机器名localhost找不到,不要理会下面的东西啦。一般来说,只要有网卡就不会出这个错的。
3) The 'localhost' machine isn't found. This could happen if you're behing a
proxy. If that's the case, make sure the proxy configuration for your
browser knows that you shouldn't be going through the proxy to access the
"localhost" machine.

In Netscape, this is under Edit/preferences -> Advanced/proxies, and in
Internet Explorer, Tools -> Internet Options -> Connections -> LAN Settings.

这其实就是tomcat自己的文档啦,呵呵,要养成看文档的习惯哦!

签名:

是缘是情是童真, 还是意外
有泪有罪有付出, 还有忍耐
是人是墙是寒冬, 藏在眼内
有日有夜有幻想, 没法等待


 
呵呵,连我的签名都带过来啦。
对了,delphibbs似乎不能设置签名?
 
老大教方法,胜读十年书
 
接受答案了.
 

Similar threads

A
回复
0
查看
932
Andreas Hausladen
A
A
回复
0
查看
981
Andreas Hausladen
A
A
回复
0
查看
806
Andreas Hausladen
A
A
回复
0
查看
400
Andreas Hausladen
A
A
回复
0
查看
607
Andreas Hausladen
A
后退
顶部