You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache 2.4无法通过域名提供Tomcat webapps下的静态资源,请求返回400错误

Apache 2.4无法通过域名提供Tomcat webapps下的静态资源,请求返回400错误

我配置了Apache Web服务器和Tomcat,Tomcat的webapps目录下有个static文件夹,里面的login.css文件负责修改网页登录界面的颜色。

用localhost访问时,登录界面的颜色能正常改变,完全符合预期;但用Apache里配置的域名访问时,颜色就没变化了,还返回了如下错误:

https://test.webpage.com/static/login.css net::ERR_ABORTED 400

以下是我的httpd.vhost.conf配置内容:

<VirtualHost *:443>
    ServerName test.webpage.com
    ServerAlias www.test.webpage.com
    ErrorLog "logs/test-error.log"
    CustomLog "logs/test-access.log" common

    <Directory "C:/Test/test2/AppServer/webapps/static/">
        Options +Indexes  
    AllowOverride None  
        Require all granted
    </Directory>  

    JkMount  /static/* prod
    JkMount  /static prod

</VirtualHost>

备注:内容来源于stack exchange,提问作者cbuyuk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 10:53:18