How to map tomcat 7 webapp to my domain

2019-04-15 22:36发布

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

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

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>

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/hostnames

HostName 

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

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

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

1条回答
我想做一个坏孩纸
2楼-- · 2019-04-15 22:56

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

123.123.123.33 my.domain.com

or

123.123.123.33 HostName.my.domaing.com HostName my.domain.com

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

查看更多
登录 后发表回答