Tomcat 安装后问题处理

安装完tomcat6后,启动tomcat

/usr/share/tomcat6/bin# ./startup.sh 后,报如下错误:

Using CLASSPATH:       /usr/share/tomcat6/bin/bootstrap.jar
touch: cannot touch `/usr/share/tomcat6/logs/catalina.out': No such file or directory
 ./catalina.sh: 375: ./catalina.sh: cannot create /usr/share/tomcat6/logs/catalina.out: Directory nonexistent

 

网上找了很多资料,发现很多资料说手动创建/logs/catalina.out,问题就不存在了。但是执行关闭操作的时候

又有错误报

经过研究发现是这个地方的问题

CATALINA_HOME=/usr/share/tomcat6
CATALINA_BASE=/usr/share/tomcat6

实际上CATALINA_BASE的位置应该在 /var/lib/tomcat6,

简单的改动CATALINA_BASE的值后发现仍然有问题,

WARNING: Problem with directory [/usr/share/tomcat6/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 24, 2013 10:26:04 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat6/server], exists: [false], isDirectory: [false], canRead: [false]
Apr 24, 2013 10:26:04 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat6/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 24, 2013 10:26:04 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat6/shared], exists: [false], isDirectory: [false], canRead: [false]
Apr 24, 2013 10:26:04 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
 at java.net.Socket.connect(Socket.java:546)
 at java.net.Socket.connect(Socket.java:495)
 at java.net.Socket.(Socket.java:392)
 at java.net.Socket.(Socket.java:206)
 at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:422)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:616)
 at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)

经过研究发现应该做个软链接

sudo ln -s /var/lib/tomcat6/* /usr/share/tomcat6/

 

然后关闭开启tomcat 问题就不存在了。

你可能感兴趣的:(linux)