Tomcat 运行不成功或运行为空白页的一种错误

打开./conf/server.xml,在最后有一个

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->
        <Context docBase="D:/Web/apache-tomcat-8.5.32/webapps/examples" path="/examples" reloadable="false" ></Context>
        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>

这一条千万不能删…这是之前查到了Tomcat无法成功运行的其中一个解决方案,就是把这个删了..我也是错误多了然后就去试了试…虽然Tomcat最后确实运行成功了但是却成了空白页面。

之后重新补上,但有不能正常运行了,这个时候要注意Context下的docBase定位要准确,以Tomcat下的自带的例子为例,修改后成功运行

另外不运行成功可能也有端口占用的原因,同样在Server.xml里改port即可

 <Connector port="8093" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

猜你喜欢

转载自blog.csdn.net/sailist/article/details/81217029