How to map tomcat 7 webapp to my domain

有些话、适合烂在心里 提交于 2019-12-06 14:25:57

问题


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:


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.




回答2:


If you already configured your firewall earlier, to redirect ports you type

sudo firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080 --permanent

and reboot it.



来源:https://stackoverflow.com/questions/28647846/how-to-map-tomcat-7-webapp-to-my-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!