我正在运行虚拟服务器在网络上Ubuntu 12.04 LTS / 32 位.
全新安装后JRE 7和Tomcat 7,按照说明http://www.sysadminslife.com,我没有启动并运行 Tomcat 7。
> java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode)
> /etc/init.d/tomcat start
Starting Tomcat
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-7-oracle
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
> telnet localhost 8080
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
netstat 有时会显示 Java 进程,但大多数时候不会。如果显示,则什么也不起作用。
有谁有解决方案或遇到过类似的情况吗?
以下是catalina.out:
16.11.2012 18:36:39 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-oracle/lib/i386/client:/usr/lib/jvm/java-6-oracle/lib/i386:/usr/lib/jvm/java-6-oracle/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
16.11.2012 18:36:40 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
16.11.2012 18:36:40 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
16.11.2012 18:36:40 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1509 ms
16.11.2012 18:36:40 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
16.11.2012 18:36:40 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.29
16.11.2012 18:36:40 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/manager
以下是结果ps-ef,iptables --列表和网络状态监测:
> ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Nov16 ? 00:00:00 init
root 2 1 0 Nov16 ? 00:00:00 [kthreadd/206616]
root 3 2 0 Nov16 ? 00:00:00 [khelper/2066167]
root 4 2 0 Nov16 ? 00:00:00 [rpciod/2066167/]
root 5 2 0 Nov16 ? 00:00:00 [rpciod/2066167/]
root 6 2 0 Nov16 ? 00:00:00 [rpciod/2066167/]
root 7 2 0 Nov16 ? 00:00:00 [rpciod/2066167/]
root 8 2 0 Nov16 ? 00:00:00 [nfsiod/2066167]
root 119 1 0 Nov16 ? 00:00:00 upstart-udev-bridge --daemon
root 125 1 0 Nov16 ? 00:00:00 /sbin/udevd --daemon
root 157 125 0 Nov16 ? 00:00:00 /sbin/udevd --daemon
root 158 125 0 Nov16 ? 00:00:00 /sbin/udevd --daemon
root 205 1 0 Nov16 ? 00:00:00 upstart-socket-bridge --daemon
root 276 1 0 Nov16 ? 00:00:00 /usr/sbin/sshd -D
root 335 1 0 Nov16 ? 00:00:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -inetd
root 348 1 0 Nov16 ? 00:00:00 cron
syslog 368 1 0 Nov16 ? 00:00:00 /sbin/syslogd -u syslog
root 472 1 0 Nov16 ? 00:00:00 /usr/lib/postfix/master
postfix 482 472 0 Nov16 ? 00:00:00 qmgr -l -t fifo -u
root 520 1 0 Nov16 ? 00:00:04 /usr/sbin/apache2 -k start
www-data 523 520 0 Nov16 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 525 520 0 Nov16 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 526 520 0 Nov16 ? 00:00:00 /usr/sbin/apache2 -k start
tomcat 1074 1 0 Nov16 ? 00:01:08 /usr/lib/jvm/java-6-oracle/bin/java -Djava.util.logging.config.file=/usr/
postfix 1351 472 0 Nov16 ? 00:00:00 tlsmgr -l -t unix -u -c
postfix 3413 472 0 17:00 ? 00:00:00 pickup -l -t fifo -u -c
root 3457 276 0 17:31 ? 00:00:00 sshd: root@pts/0
root 3459 3457 0 17:31 pts/0 00:00:00 -bash
root 3470 3459 0 17:31 pts/0 00:00:00 ps -ef
> iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http-alt
ACCEPT tcp -- anywhere anywhere tcp dpt:8005
ACCEPT tcp -- anywhere anywhere tcp dpt:http-alt
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
> netstat -plut
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:smtp *:* LISTEN 472/master
tcp 0 0 *:3213 *:* LISTEN 276/sshd
tcp6 0 0 [::]:smtp [::]:* LISTEN 472/master
tcp6 0 0 [::]:8009 [::]:* LISTEN 1074/java
tcp6 0 0 [::]:3213 [::]:* LISTEN 276/sshd
tcp6 0 0 [::]:http-alt [::]:* LISTEN 1074/java
tcp6 0 0 [::]:http [::]:* LISTEN 520/apache2
答案1
这安装以上是正确的,感谢@Fuzzyfelt 的验证。
在尝试了其他 Java 版本多次失败后,我放弃了,并(再次)在网上搜索提示。最后,我偶然发现了这篇文章
http://orange-coding.net/2012/08/10/strato-vserver-ubunut-12-04java/
Strato (strato.de) 的虚拟化软件在运行带有 Java 的 Ubuntu 12.04 LTS 时出现错误。
今天切换到 Ubuntu 10.04 LTS,一切都很好!
我会把这篇文章留在这里,除非有人给我一个合理的理由删除它。就我而言,网络上应该有更多资源指出 Ubuntu 12.04 LTS 和 Strato 上的 Java 存在的问题。