我在我的vps(debian)上安装了tomcat8和apache2,我想知道如何重定向 mydomain.com 到 mydomaine.com: 8080 / myproject 以便将apache2转发给tomcat。
我还想知道是否可以允许访问:8080只能访问我的apache(只能从我的localhost获取)
答案 0 :(得分:0)
这个问题非常广泛,但简短的回答是你需要将Apache httpd配置为Tomcat的“反向代理”。阅读<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.js"></script>
<div class="item">
<p class="product-name">product name</p>
<div class="star-rating rateYo" data-rating='5'></div>
<p class="price">$100.00</p>
<p class="starting-at">Starting at: <span>$50.00</span></p>
<div class="add-to-cart">
<button><i class="fa fa-shopping-cart" aria-hidden="true"></i>Add to Cart</button>
</div>
</div>
<div class="item">
<p class="product-name">product name</p>
<div class="star-rating rateYo" data-rating='3'></div>
<p class="price">$100.00</p>
<p class="starting-at">Starting at: <span>$50.00</span></p>
<div class="add-to-cart">
<button><i class="fa fa-shopping-cart" aria-hidden="true"></i>Add to Cart</button>
</div>
</div>
<div class="item">
<p class="product-name">product name</p>
<div class="star-rating rateYo" data-rating='2.5'></div>
<p class="price">$100.00</p>
<p class="starting-at">Starting at: <span>$50.00</span></p>
<div class="add-to-cart">
<button><i class="fa fa-shopping-cart" aria-hidden="true"></i>Add to Cart</button>
</div>
</div>
的文档,了解如何执行此操作。
最终,您将要使用以下内容将应用程序的URI空间(mod_proxy
)映射到Tomcat(/myapp
):
localhost:8080/myapp
cookie路径和重定向等工作都需要这两行。 不要尝试重新命名Web应用程序(例如从/ myapp到/ someotherapp)。