美文网首页Tomcat
java,tomcat环境变量与web认证

java,tomcat环境变量与web认证

作者: 词穷又词贫 | 来源:发表于2017-10-16 13:53 被阅读22次

    java环境变量:

    JAVA_HOME=/usr/local/java
    JAVA_BIN=$JAVA_HOME/bin 
    JRE_HOME=$JAVA_HOME/jre
    PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
    CLASSPATH=$JRE_HOME/lib:$JAVA_HOME/lib:$JRE_HOME/lib/charsets.jar
    export JAVA_HOME JAVA_BIN JRE_HOME PATH CLASSPATH
    

    Tomcat环境变量:

    PATH=/usr/local/tomcat/bin:$PATH
    CATALINA_HOME=/usr/local/tomcat
    CATALINA_BASE=/usr/local/tomcat
    CATALINA_TMPDIR=/usr/local/tomcat/temp
    export PATH CATALINA_HOME CATALINA_BASE CATALINA_TMPDIR
    

    web认证登录:
    tomcat7:

    $CATALINA_BASE/conf/tomcat-users.xml
      <role rolename="manager-gui"/>
      <user username="tomcat" password="manager1" roles="manager-gui"/>
    

    tomcat8:

    除了上面的配置外,还需要配置:
    $CATALINA_BASE/conf/Catalina/localhost/manager.xml
    <Context privileged="true" antiResourceLocking="false"
         docBase="${catalina.home}/webapps/manager">
      <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
    </Context>

    相关文章

      网友评论

        本文标题:java,tomcat环境变量与web认证

        本文链接:https://www.haomeiwen.com/subject/zvpkuxtx.html