本文介绍了如何Tomcat 7的Web应用程序映射到我的域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这已经在几个方面已经感动了,但我仍然有问题 - 我有一个Web应用程序:

I know this has been touched upon in several ways already, but i'm still having issues - I have a webapp in:

/var/lib/tomcat7/webapps/abc.war

/var/lib/tomcat7/webapps/abc.war

我在说一个域名,my.domain.com

I have a domain at say, my.domain.com

我添加这对我的conf / server.xml中(我相信这是正确的设置?)
文档库点战争文件夹?

I've added this to my conf/server.xml (which i believe is set correctly?)Docbase points to the war folder?

<Host name="my.domain.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="/abc" debug="0" privileged="true" />
    <Valve className="org.apache.catalina.valves.AccessLogValve"
          directory="logs"   prefix="localhost_access_log." suffix=".txt"
       pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false" />
</Host>

我的域IP在/ etc / hosts中沿W /本地主机IP:

My domain ip is in the /etc/hosts along w/ the local host ip:

127.0.0.1 localhost
123.123.123.33 HostName.my.domaing.com HostName

$的/ etc /主机名

$ /etc/hostnames

HostName

使用我目前的设置上面,我感到没有得到任何结果在网上看到我的webapp。任何想法将不胜感激!

With my current settings above i'm am not getting any results in seeing my webapp online. Any thoughts would be very grateful!

我的域已被映射到我的/ var / www / html等目录了。我可以在网上看到我的临时index.html文件。我的Tomcat Web应用程序通过IP工作正常:8080 / ABC

My domain already is mapped to my /var/www/html directory too. I can see my temp index.html file online. My tomcat webapp works fine through ip:8080/abc

我工作Ubuntu服务器14.04上 - 的Apache2
这是我第一次工作瓦特/ tomcat的,这是一个有点混乱。
谢谢!

I'm working on Ubuntu Server 14.04 - Apache2This is my first time working w/ tomcat and it's a bit confusing.Thank You!

推荐答案

您的/ etc / hosts中应该包含这样一个条目:

Your /etc/hosts should contain an entry like this:

123.123.123.33 my.domain.com

123.123.123.33 HostName.my.domaing.com主机名my.domain.com

否则,你将无法解析名称my.domain.com连接到您的Tomcat。

Otherwise you won't be able to resolve the name my.domain.com to connect to your Tomcat.

这篇关于如何Tomcat 7的Web应用程序映射到我的域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 04:29