tomcat8 安装|解决启动慢|进入管理|host-manager 403错误
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tomcat8 安装|解决启动慢|进入管理|host-manager 403错误相关的知识,希望对你有一定的参考价值。
cd /usr/local/src wget http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html ##需要进去,点介绍协议,下载jdk8 tar zxvf jdk-8u144-linux-x64.tar.gz mv jdk1.8.0_144/ /usr/local/jdk8.0 vim /etc/profile JAVA_HOME=/usr/local/jdk8.0 JAVA_BIN=/usr/local/jdk8.0/bin PATH=$PATH:$JAVA_BIN CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME JAVA_BIN PATH CLASSPATH export CATALINA_BASE=/usr/local/tomcat export CATALINA_HOME=/usr/local/tomcat source /etc/profile cd /usr/local/src/ wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.23/bin/apache-tomcat-8.5.23.tar.gz tar zxvf apache-tomcat-8.5.23.tar.gz mv apache-tomcat-8.5.23 /usr/local/tomcat8.5 ln -s /usr/local/tomcat8.5/ /usr/local/tomcat cd /usr/local/tomcat/bin/ echo "CATALINA_HOME=/usr/local/tomcat8.5/" >> catalina.sh chmod +x *.sh ./startup.sh
启动慢修改如下:
在catalina.sh中加入这么一行:
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"
打开$JAVA_PATH/jre/lib/security/java.security这个文件,找到下面的内容:
securerandom.source=file:/dev/urandom
替换成
securerandom.source=file:/dev/./urandom
想登陆管理页面,操作如下:
conf/Catalina/localhost/下创建 manager.xml , 填入如下内容
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager"> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" /> </Context> 添加用户 conf/tomcat-users.xml 中的 <tomcat-users></tomcat-users> 标签内添加如下代码: <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/> <user username="deploy" password="deploy" roles="manager-script"/>
host-manager 还是 403 错误 解决办法 允许所有IP访问
vim /usr/local/tomcat/webapps/host-manager/META-INF/context.xml <Context antiResourceLocking="false" privileged="true" > <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" /> #修改这里 </Context>
本文出自 “何全” 博客,请务必保留此出处http://hequan.blog.51cto.com/5701886/1984005
以上是关于tomcat8 安装|解决启动慢|进入管理|host-manager 403错误的主要内容,如果未能解决你的问题,请参考以下文章