繁体   English   中英

如何在Apache Web服务器中配置tomcat Java应用程序?

[英]How to configure tomcat java application in apache web server?

我刚刚在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应用了。

谢谢

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM