0

我需要在Google計算引擎(Apache HTTP和Glassfish HTTP兩個端口80)上的相同實例中啓動兩個服務HTTP。我已經在尋找端口轉發和ip,但是發現它們都很混亂。有沒有人需要這種環境?你能一步步幫助我嗎?兩項服務HTTP谷歌計算引擎

回答

0

您無法在同一端口上啓動兩項服務。您需要將HTTP請求重定向到Tomcat。爲了實現這一點,您需要將您的Apache配置爲反向代理。在這裏你可以閱讀更多關於它[1]。

這是來自Apache文檔[2]中提取時許例如:

# mod_proxy setup. 
ProxyRequests Off 
ProxyPass /webapps http://localhost:8080 
ProxyPassReverse /webapps http://localhost:8080 

<Location "/webapps"> 
    # Configurations specific to this location. Add what you need. 
    # For instance, you can add mod_proxy_html directives to fix 
    # links in the HTML code. See link at end of this page about using 
    # mod_proxy_html. 

    # Allow access to this proxied URL location for everyone. 
    Order allow,deny 
    Allow from all 
</Location> 

在這裏,[3],你可以找到一個教程一步一步。

[1] https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html [2] https://wiki.apache.org/httpd/TomcatReverseProxy [3] https://rvdb.wordpress.com/2012/04/26/reverse-proxying-tomcat-webapps-behind-apache/