我有下一个网络:Internet电缆->路由器->服务器-> tomcat,已安装在服务器上。 Tomcat正在端口8090上工作。 我可以从localhost:8090访问tomcat,但不能访问external_ip_adress:8090。 端口转发完成。 要管理服务器,请使用RDP external_ip_adress:8090。 这是我的server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
useIPVHosts="true"
resolveHosts="true"
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
我应该怎么做才能从外部ip访问tomcat。可能是其他设置或其他端口转发。请,帮助菜鸟)
答案 0 :(得分:0)
经过研究,确定这些更改可能会有所帮助(如果您仍在努力解决同一问题,请尝试一下):
进行以下更改,我们将打开其他主机的访问权限:
编辑'CATALINA_HOME / webapps / host-manager / META-INF / context.xml'
<!-Valve className =“ org.apache.catalina.valves.RemoteAddrValve” allow =“ 127. \ d +。\ d +。\ d + | :: 1 | 0:0:0:0: 0:0:0:1“ /->
希望这能回答您的问题!