简体   繁体   中英

How I can connect Apache server remotely (http://149.4.223.238:8080) through my local machine

I am using Eclipse with Tomcat 8.0 and successfully run and deploy web application into Apache server. Now my question is how I can access online apache host address app manager in order to deploy my application on this host Remove Server Address

tomcat_users.xml

<tomcat-users>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>   
<user username="tom" password="tom123" roles="admin-gui"/>
<user username="malik" password="malik123" roles="manager-gui,manager-script,manager-jmx,manager-status"/>

</<tomcat-users>

I added this to server.xml

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" address="149.4.223.238" redirectPort="8443"/>

Context.xml

<Context antiResourceLocking="false" privileged="true" >
  <!--
    Remove the comment markers from around the Valve below to limit access to
    the manager application to clients connecting from localhost
  -->

  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="149\.4\.223\.238|127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />

 </Context>

I am searching from last 5-7 hours but still not understand.

http://149.4.223.238:8080/manager/html

It looks like you might not have configured it yet. that link also tell you how to set it up. Also if you remote connect with that machine and access that site through localhost:8080/manager/html that should work too.

more details at

https://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

Your valve configuration is restricting access to IPs in the server itself, the public one and the loopback addresses

<Valve className="org.apache.catalina.valves.RemoteAddrValve"
     allow="149\.4\.223\.238|127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />

So, if you want to allow access from your public IP (be careful with that, it's a security hole) you should include it on the regexp. As an option, you can access it through an ssh tunnel (can be done with putty too)

ssh -L 8080:localhost:8080 some_user@149.4.223.238

Now it should be accessible from localhost:8080.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM