7

我正在使用 ubuntu 9.10,并使用包管理器安装了 java 和 tomcat。当我去运行 startup.sh 时,它首先抱怨 catalina.out 不存在并且不可写。我解决了这个问题,它没有抱怨(为什么不包含在安装中??)现在它抱怨当我关闭服务器时 server.xml 不存在。这是我的命令行输出:

user@desktop:/usr/share/tomcat6$ ./bin/startup.sh 
Using CATALINA_BASE:   /usr/share/tomcat6
Using CATALINA_HOME:   /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun-1.6.0.15
user@desktop:/usr/share/tomcat6$ ./bin/shutdown.sh
Using CATALINA_BASE:   /usr/share/tomcat6
Using CATALINA_HOME:   /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun-1.6.0.15
Dec 11, 2009 4:42:57 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: 
java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:407)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
user@desktop:/usr/share/tomcat6$

我真的是 tomcat 的新手,所以这可能是一个愚蠢的问题,但是为什么在全新安装的 tomcat 中没有示例 server.xml?我可以在里面放什么来让它闭嘴……即使它只是一个存根,并且对任何可以向我解释这个文件的结构的人加 1?

4

2 回答 2

6

尝试使用位于以下位置的 server.xml:

/etc/tomcat6/server.xml

server.xml 是应用服务器的配置文件。它包含诸如服务器将要侦听的端口、正在部署的应用程序的位置以及其他相关内容之类的内容。

于 2009-12-12T00:56:01.207 回答
1

有关 Ubuntu 中 Tomcat 的更多信息:

https://help.ubuntu.com/12.04/serverguide/tomcat.html

于 2009-12-12T00:57:44.370 回答