如何设置指向不同端口和上下文路径的虚拟主机?
我正在开发一个 JSF 2.0 项目,并将其作为 .war 文件放在 Apache Tomcat 7.0.5 服务器上。我已经部署了它,并且可以在 http://localhost:9080/exampleApp1 处查看它。
我最近购买了一个域名。所以我在我的服务器中设置了一个虚拟主机,这样当有人进入 www.theDomainIBought.com 时,它就会进入我的服务器,并且我有一个小 html 文件,上面写着正在建设中。
我想做的是每当有人进入 www.theDomainIBought.com 我希望他们打开 exampleApp1。最好(最简单)的方法是什么?有人告诉我要设置一个虚拟主机,但我发现的所有示例都表明他们需要输入 www.theDomainIBought.com:9080/exampleApp1 这不是我想要的,我希望他们只输入域(www .theDomainIBought.com),它将打开该应用程序。我怎样才能做到这一点?
我有两个 apache,一个带有 wamp 服务器,另一个是我部署应用程序的。 这就是我现在在 wamp/apache httpd.conf 文件中用于托管的内容:
<VirtualHost *:80>
DocumentRoot "C:\wamp\www\domainIBought"
ServerName www.domainIBought.com
ServerAlias domainIBought.com
</VirtualHost>
但它不允许我放置 VirtualHost *:9080/exampleApp1
I'm working on a JSF 2.0 project and I have it on an Apache Tomcat 7.0.5 Server as a .war file. I've deployed it and I can view it at http://localhost:9080/exampleApp1.
I recently purchased a domain name. so I've set up a virtual host in my server so that when someOne goes into www.theDomainIBought.com it goes to my server and I have a little html file that says under construction.
what I want to do is Whenever someone goes into www.theDomainIBought.com I want them to open up the exampleApp1. What is the best(easiest) way to do this? I was told to set up a virtual host but all the examples I found says they'd need to type in www.theDomainIBought.com:9080/exampleApp1 Which is NOT what I want, I want them to just put in the domain (www.theDomainIBought.com) and it'll open up the app. how can I achieve this?
I have two apaches, one that came with wamp server and the onw I deploy my app in.
this is what I have in my wamp/apache httpd.conf file for the hosting right now:
<VirtualHost *:80>
DocumentRoot "C:\wamp\www\domainIBought"
ServerName www.domainIBought.com
ServerAlias domainIBought.com
</VirtualHost>
but it won't let me put VirtualHost *:9080/exampleApp1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要配置 mod_jk 将流量从 Apache 重定向到 Tomcat。检查以下文档:
http://tomcat.apache.org/connectors-doc/ webserver_howto/apache.html
You need to configure mod_jk for redirect the traffic from Apache to Tomcat. check the following documentation:
http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html