Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照文档打包war并没有静态资源 #12

Open
zhuangjiagen163 opened this issue Nov 4, 2022 · 2 comments
Open

按照文档打包war并没有静态资源 #12

zhuangjiagen163 opened this issue Nov 4, 2022 · 2 comments

Comments

@zhuangjiagen163
Copy link

打包war后部署访问不到,因为静态资源压根就没有 不解

@Qbian61
Copy link
Owner

Qbian61 commented Apr 14, 2023

需要通过根目录访问才行

@Staceycgc
Copy link

Staceycgc commented Oct 15, 2023

部署war时缺少了一步:

修改/root/apache-tomcat-9.0.65/conf/server.xml,在Host标签内添加一个Context标签,内容如下:

<Host name="localhost"  appBase="webapps"
          unpackWARs="true" autoDeploy="true">
     <Context path="/root/apache-tomcat-9.0.65/webapps/" docBase="forum-java.war" debug="0" privileged="true" reloadable="true"></Context>
     <!-- SingleSignOn valve, share authentication between web applications
          Documentation at: /docs/config/valve.html -->
     <!--
     <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
     -->

     <!-- 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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants