阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

时间:2021-06-16 04:13:39

JDK1.8运行./shutdown 停止tomcat报错:

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

昨天购买了一个阿里云服务器,由于时间问题今天才来启动tomcat,启动的时候才发现跟我以前使用的服务器不太一样,去网上搜索了半天以为是tomcat内存太小,折腾了一上午,后来才发现是tomcat没有完全启动好

1.找到jdk地址

依次是用 which java 然后 ls -lrt /usr/java/jdk/jdk1.8.0_181/bin/java 最终得到的结果前面部分才是jdk的路径

/usr/java/jdk/jdk1.8.0_181

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

2.进入 /usr/java/jdk/jdk1.8.0_181/jre/lib/security/ 目录下 (cd /usr/java/jdk/jdk1.8.0_181/jre/lib/security/)

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

3.修改java.security (vim java.security)

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

4 、 将 "securerandom.source=file:/dev/random"
修改为"securerandom.source=file:/dev/./urandom",保存退出(按esc,输入”:wq”,回车) 
(在 vim 中进行文本搜索:输入”/”,再输入关键词,回车,按“n”向下查找匹配词,按“N”向上查找匹配词; 
eg:输入“/securerandom.source”,回车,按“n”直到找到“securerandom.source=file:/dev/random”)

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

5、启动tomcat,分分钟 shutdown、startup。

未修改前:

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.

修改后:

阿里云服务器tomcat ./shutdown.sh关闭命令报错Could not contact localhost:8005. Tomcat may not be running.