로컬 호스트에서만 작동하는 Apache TomCat - Windows 2012

로컬 호스트에서만 작동하는 Apache TomCat - Windows 2012

Windows Server 2012에 Apache Tomcat을 설치했으며 로컬로 액세스할 수 있습니다.

지금까지 다음을 시도했습니다. - 방화벽을 통해 포트를 열었습니다. - 클라우드 서버 호스트를 통해 포트를 열었습니다. - Windows 방화벽을 끄고 - server.xml 파일을 변경했습니다. - 포트 90이 작동하는지 확인한 클라우드 서버 호스트에 연결했습니다. - 내 호스팅 제공업체에서 시도해 보았으나 제대로 작동하지 못했습니다.

서비스를 중지했다가 다시 시작했는데 아무 것도 작동하지 않았습니다.

아래는 내 server.xml 파일입니다. 액세스하려고 할 때 로그에 오류가 포함되지 않은 것 같습니다.

  http://www.apache.org/licenses/LICENSE-2.0

해당 법률에서 요구하거나 서면으로 동의하지 않는 한, 라이선스에 따라 배포되는 소프트웨어는 명시적이든 묵시적이든 어떠한 종류의 보증이나 조건 없이 "있는 그대로" 배포됩니다. 라이선스에 따른 허가 및 제한 사항을 관리하는 특정 언어는 라이선스를 참조하세요. --> -->

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
    maxThreads="150" minSpareThreads="4"/>
-->


<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="9090" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
     address="0.0.0.0" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
           port="9090" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
    address="0.0.0.0" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


<!-- An Engine represents the entry point (within Catalina) that processes
     every request.  The Engine implementation for Tomcat stand alone
     analyzes the HTTP headers included with the request, and passes them
     on to the appropriate Host (virtual host).
     Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">

  <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html  (simple how to)
      /docs/config/cluster.html (reference documentation) -->
  <!--
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  -->

  <!-- Use the LockOutRealm to prevent attempts to guess user passwords
       via a brute-force attack -->
  <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/>
  </Realm>

  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">

    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <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" />

  </Host>
</Engine>

현재 이리저리 돌아다니는 것 같으니 도움을 주세요.

미리 감사드립니다. 존

답변1

이것은 리눅스에서 저에게 효과적이었습니다. Windows에서 이 수정 사항을 시도하여 Tomcat에 원격으로 액세스할 수 있습니다.

텍스트 편집기에서 다음 두 XML 파일을 열고 아래 줄을 주석 처리합니다.

1) $CATALINA_HOME/webapps/manager/META-INF/context.xml

2) $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" />-->

Tomcat 서버를 다시 시작하고 이 솔루션이 도움이 되는지 확인하세요.

답변2

많은 시간이 지난 후에도 내 호스팅 회사가 올바른 방화벽 포트를 열지 않은 것 같습니다. 예를 들어 8080 대신 80을 열었습니다.

Leasson은 항상 직감에 따라 행동한다는 것을 배웠습니다. 여기에 놓기 전에 열려 있는지 물었지만 그렇지 않았습니다.

어쨌든 이 문제와 관련하여 여기에 오는 사람은 방화벽 포트가 열려 있는지 세 번 확인하십시오.

다른 사람에게 도움이 되기를 바랍니다.

고마워요 존

관련 정보