2016-11-29 118 views
0

我只是配置的Apache Tomcat的java應用程序如下圖所示。如何在apache web服務器中配置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 

任何人都可以幫助我,我應該在哪裏改變這個配置?

Regards,

+0

中的httpd的'error.log'或Tomcat的'catalina.out'任何錯誤? –

回答

1

我自己解決了這個問題。有什麼我剛纔提到的配置沒有問題..

<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網址我可以現在能夠參照tomcat的應用程序。

感謝

相關問題