刚刚在我的Digital Ocean Ubuntu 14.04 Droplet上升级了软件 sudo apt-get update和sudo apt-get upgrade。不幸的是我没有正确地阅读这个问题 - 关于tomcat7和java的问题。由于这个tomcat7在端口8080上没有响应 - 最终超时。
ps -ef | grep tomcat:
tomcat7 1711 1 2 15:16 ? 00:00:53 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx256m -Xms48m -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start
tree-ma+ 2056 1596 0 15:53 pts/1 00:00:00 grep --color=auto tomcat
catalina.out输出:
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 657 ms
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/geoserver.war
log4j:WARN File option not set for appender [geoserverlogfile].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
Apr 25, 2017 3:16:36 PM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup occured, but ApplicationContext is unset.
catalina.2017-04-25.log:
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Apr 25, 2017 3:16:19 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 657 ms
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 25, 2017 3:16:19 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Apr 25, 2017 3:16:19 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/geoserver.war
Apr 25, 2017 3:16:36 PM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup occured, but ApplicationContext is unset.
netstat -na | grep -e 8080给出:
tcp6 0 0 :::8080 :::* LISTEN
tcp6 510 0 95.85.22.89:8080 176.71.34.121:49840 CLOSE_WAIT
tcp6 510 0 95.85.22.89:8080 176.71.34.121:49837 CLOSE_WAIT
tcp6 380 0 95.85.22.89:8080 83.248.187.2:46220 CLOSE_WAIT
tcp6 510 0 95.85.22.89:8080 176.71.34.121:49841 CLOSE_WAIT
tcp6 510 0 95.85.22.89:8080 176.71.34.121:49836 CLOSE_WAIT
tcp6 379 0 95.85.22.89:8080 83.248.187.2:46355 ESTABLISHED
tcp6 510 0 95.85.22.89:8080 176.71.34.121:49839 CLOSE_WAIT
tcp6 510 0 95.85.22.89:8080 176.71.34.121:49838 CLOSE_WAIT
83.248.187.2是我的家。
我的电脑上的nmap 95.85.22.89显示:
Starting Nmap 6.40 ( http://nmap.org ) at 2017-04-25 16:46 CEST
Nmap scan report for 95.85.22.89
Host is up (0.067s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
25/tcp filtered smtp
80/tcp open http
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
443/tcp open https
445/tcp filtered microsoft-ds
1025/tcp filtered NFS-or-IIS
6129/tcp filtered unknown
8080/tcp open http-proxy
所以8080是开放的。 我有一个webapp - geoserver(我认为v2.5.5.8,但现在还不能实现!) 有什么想法吗?
答案 0 :(得分:0)
我以为我已经“整理”了这个问题:
sudo service tomcat7 stop
cp -R /var/lib/tomcat7/webapps/geoserver/data ./safe_storage_location
sudo apt-get purge tomcat7 libtomcat7-java
sudo apt-get autoremove
sudo apt-get update
sudo apt-get install tomcat7
然后,下载geoserver war zipfile:我去了2.8.3(http://geoserver.org/release/2.8.3/)
unzip geoserver.war.zip
mv geoserver.war /var/lib/tomcat7/webapps
等一下,tomcat打开战争等等......
转到主机名:8080 / geoserver - 验证您是否拥有地理服务器。
sudo service tomcat7 stop
cp -R ./safe_storage_location /var/lib/tomcat7/webapps/geoserver/data
sudo service tomcat7 start
等待,
等等,
最终,旧的地理服务器就在那里 - 在我的情况下等待10-15分钟。
在我的情况下,清除还删除了Oracle的Java 7 JRE以及我完成的一些geoserver特定的java配置,然后我编辑了/ etc / default / tomcat7,并替换了
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"
与
JAVA_OPTS="-Djava.awt.headless=true -Xmx256m -Xms48m -XX:SoftRefLRUPolicyMSPerMSPerMB=36000 -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC"
然后我编辑了/var/lib/tomcat7/webapps/geoserver/WEB-INF/web.xml,并添加了:
<context-param>
<param-name>GEOWEBCACHE_CACHE_DIR</param-name>
<param-value>/var/tmp</param-value>
</context-param>
所以它会使用我的GeoWebCache。
但是 - 请参阅here这是我遇到的问题......大约30分钟的启动时间为tomcat。我的服务器是Digital Ocean,我不知道这是否很重要。
一旦启动,tomcat7 / geoserver运行良好。