关于TOMCAT+APACHE的整合问题

02-12-06 祝枝山

本人决定把公司目前SUN OS上的纯C写的CGI程序改成JSP+SERVLET的方式,

于是需要另外安装TOMCAT,我用的版本是jakarta-tomcat-3.3.1,

我已经严格按照网上找到的一些资料分别安装了

ApacheJServ-1.1.2和JSDK2.0和Solaris_JDK_1.2.2_14(按照说明系统连接成了JDK)和mod_jserv.so。

我的APACHE版本是1。3。26,使用DSO动态编译的,

各个软件分别安装完后,按照说明分别在apache的HTTPD。CONF和TOMCAT的TOMCAT。CONF和SERVER。XML配置文件作了修改;

最后启动TOMCAT,显示的结果是:

----------------------------------------------------------------------------

# ./startup.sh start

Using classpath: ./../lib/tomcat.jar

Using JAVA_HOME: /usr/local/jdk

Using TOMCAT_HOME: ..

# 2002-12-06 16:58:32 - ServerXmlReader: Config=$TOMCAT_HOME/conf/server.xml

2002-12-06 16:58:32 - PathSetter: home=/usr/local/jakarta-tomcat-3.3.1

2002-12-06 16:58:32 - ContextXmlReader: Context config=$TOMCAT_HOME/conf/apps-12

7.0.0.1.xml

2002-12-06 16:58:32 - ContextXmlReader: Context config=$TOMCAT_HOME/conf/apps-ad

min.xml

2002-12-06 16:58:32 - ContextXmlReader: Context config=$TOMCAT_HOME/conf/apps-ex

amples.xml

2002-12-06 16:58:32 - AutoWebApp: Loaded from config: DEFAULT:/admin

2002-12-06 16:58:32 - AutoWebApp: Auto-Adding DEFAULT:/

2002-12-06 16:58:32 - AutoWebApp: Loaded from config: DEFAULT:/examples

2002-12-06 16:58:32 - ContextManager: Tomcat configured and in stable state

2002-12-06 16:58:32 - ContextManager: Adding DEFAULT:/admin

2002-12-06 16:58:32 - ContextManager: Adding DEFAULT:/examples

2002-12-06 16:58:32 - ContextManager: Adding DEFAULT:/ROOT

EmbededTomcat: Init time 1377

Guessed home=/usr/local/jakarta-tomcat-3.3.1

Guessed home=/usr/local/jakarta-tomcat-3.3.1

Exception: java.lang.reflect.InvocationTargetException

java.lang.reflect.InvocationTargetException: org.apache.tomcat.core.TomcatExcept

ion: Root cause - Address already in use:9090

at java.lang.Throwable.fillInStackTrace(Native Method)

at java.lang.Throwable.fillInStackTrace(Compiled Code)

at java.lang.Throwable.(Compiled Code)

at java.lang.Exception.(Compiled Code)

at org.apache.tomcat.core.TomcatException.(TomcatException.java:85

)

at org.apache.tomcat.modules.server.PoolTcpConnector.engineStart(Compile

d Code)

at org.apache.tomcat.core.ContextManager.start(Compiled Code)

at org.apache.tomcat.startup.EmbededTomcat.start(EmbededTomcat.java:586)

at org.apache.tomcat.startup.EmbededTomcat.execute1(EmbededTomcat.java:7

10)

at org.apache.tomcat.startup.EmbededTomcat$1.run(EmbededTomcat.java:687)

at org.apache.tomcat.util.compat.Jdk12Support$PrivilegedProxy.run(Jdk12S

upport.java:190)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.tomcat.util.compat.Jdk12Support.doPrivileged(Jdk12Support.

java:100)

at org.apache.tomcat.startup.EmbededTomcat.execute(EmbededTomcat.java:68

5)

at java.lang.reflect.Method.invoke(Native Method)

at org.apache.tomcat.util.IntrospectionUtils.execute(IntrospectionUtils.

java:87)

at org.apache.tomcat.startup.Main.execute(Main.java:313)

at org.apache.tomcat.startup.Main.main(Main.java:140)

Root Exception: org.apache.tomcat.core.TomcatException: Root cause - Address alr

eady in use:9090

org.apache.tomcat.core.TomcatException: Root cause - Address already in use:9090

at java.lang.Throwable.fillInStackTrace(Native Method)

at java.lang.Throwable.fillInStackTrace(Compiled Code)

at java.lang.Throwable.(Compiled Code)

at java.lang.Exception.(Compiled Code)

at org.apache.tomcat.core.TomcatException.(TomcatException.java:85

)

at org.apache.tomcat.modules.server.PoolTcpConnector.engineStart(Compile

d Code)

at org.apache.tomcat.core.ContextManager.start(Compiled Code)

at org.apache.tomcat.startup.EmbededTomcat.start(EmbededTomcat.java:586)

at org.apache.tomcat.startup.EmbededTomcat.execute1(EmbededTomcat.java:7

10)

at org.apache.tomcat.startup.EmbededTomcat$1.run(EmbededTomcat.java:687)

at org.apache.tomcat.util.compat.Jdk12Support$PrivilegedProxy.run(Jdk12S

upport.java:190)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.tomcat.util.compat.Jdk12Support.doPrivileged(Jdk12Support.

java:100)

at org.apache.tomcat.startup.EmbededTomcat.execute(EmbededTomcat.java:68

5)

at java.lang.reflect.Method.invoke(Native Method)

at org.apache.tomcat.util.IntrospectionUtils.execute(IntrospectionUtils.

java:87)

at org.apache.tomcat.startup.Main.execute(Main.java:313)

at org.apache.tomcat.startup.Main.main(Main.java:140)

----------------------------------------------------------------------------

然后启动APACHE是显示的结果是:

-----------------------------------------------------------------------------

# ./apachectl restart

./apachectl restart: configuration broken, ignoring restart

./apachectl restart: (run 'apachectl configtest' for details)

-----------------------------------------------------------------------------

于是我运行./apachectl configtest显示结果:

-----------------------------------------------------------------------------

# ./apachectl configtest

Syntax error on line 32 of /usr/local/apache/conf/tomcat.conf:

Invalid command 'AddType', perhaps mis-spelled or defined by a module not includ

ed in the server configuration

-----------------------------------------------------------------------------

那个32行那里是这样的:

...

...

18 # @LOAD_OR_NOT@LoadModule jserv_module @LIBEXECDIR@/mod_jserv.so

19 LoadModule jserv_module /usr/local/apache/libexec/mod_jserv.so

20

21 # Do not edit!

22 ApJServManual on

23 ApJServDefaultProtocol ajpv12

24 ApJServSecretKey DISABLED

25 ApJServMountCopy on

26 ApJServLogLevel notice

27 ### Change if you run tomcat on a different host

28 #ApJServDefaultHost localhost

29 ApJServDefaultPort 8007

30 #################### All jsp files will go to tomcat ####################

31 ApJServMount default /root

32 AddType text/jsp .jsp

33 AddHandler jserv-servlet .jsp

前面的序号是我在这里临时加上去的。

问题是,启动APACHE时的错误提示“...or defined by a module not included in the server configuration”说我的支持JSP模块没有编译到APACHE中去?好象所有的资料中没看到APACHE中要编译进这个东西吗?不是说APACHE动态编译了就行了吗?请问本人的安装可能错在什么地方?

本人已经化了一个星期在这个安装工作上了,现在实在没有办法了,只好在这里求助于各位有过类似经验的同志,帮俺一把,多谢了!!!