gpt4 book ai didi

java - 如何在 apache web 服务器中配置 tomcat java 应用程序?

转载 作者:行者123 更新时间:2023-11-28 22:50:39 24 4
gpt4 key购买 nike

我刚刚在 apache 中配置了 tomcat java 应用程序,如下所示。

<VirtualHost *:80>
ServerName domain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/app_name
ProxyPassReverse / http://localhost:8080/app_name
</VirtualHost>

后来我使用 a2ensite adavipalem.conf 启用站点并重新启动服务器。

当我尝试通过点击类似 >> domain.com 从浏览器访问时我在浏览器中看到类似下面的内容。

    Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.7 (Ubuntu) Server at adavipalem.com Port 80

任何人都可以帮助我在哪里更改此配置?

问候,

最佳答案

我自己解决了这个问题。我之前提到的配置没有问题..

<VirtualHost *:80>
ServerName domain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/app_name
ProxyPassReverse / http://localhost:8080/app_name
</VirtualHost>

我只是忘了启用

a2enmod proxy_http

因此,我无法发出 HTTP 请求,最终我被困在 apache 本身。后来我启用了 proxy_http,现在它代理我到 tomcat url 我现在可以引用 tomcat 应用程序了。

谢谢

关于java - 如何在 apache web 服务器中配置 tomcat java 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40857261/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com