简体   繁体   中英

Unable to access Tomcat Apache server from remote machine using browser

I am having Apache Tomcat 5.5 version installed on a remote machine. Application is using Java servlets and mysql database. I need to access that pages using a specific ip address(http://192.168.2.2:8080/myapps) on any system.

Please provide me a references link or steps to access remote server web pages.

Regards,

Sounds like you have either a firewall on the machine with tomcat on it, you have its IP address wrong, or you are on a network which cant connect to it.

Can you access it on the machine it is on (ie, the one where you can access it as localhost:8080/myapps) with the remote address - http://192.168.2.2:8080/myapps ? If not the address is wrong.

If the browser can't access 192.168.2.2 at all it means you have a firewall on that machine or that you are trying it from an address that doesn't start 192.168.

EDIT :

the address 192.168.xx is a 'private address', which means nothing outside that address range can connect to it, and it can't go onto the internet. If you want to access it from the internet, you need a way to translate a public address (such as the one you listed xxx.125.xxx.158) to your private address, such as a router with port forwarding set up.

Without that you won't be able to connect to it.

I had the same problem in my windows 2012 server OS, I just have added an exception to port on which the tomcat apache was running.

for adding exception to port use the following step

1) Open Windows Firewall by clicking the Start button Picture of the Start button, and then clicking Control Panel. In the search box, type firewall, and then click Windows Firewall.

2) In the left pane, click Advanced settings. Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.

3) In the Windows Firewall with Advanced Security dialog box, in the left pane, click Inbound Rules, and then, in the right pane, click New Rule.

4) Now select port and click next, now enter your port in specific local ports OR check on All local port. That's ALL

Please change the allow attribute value in the context.xml file, present in webapps/manager/meta-inf folder.

Old configuration

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

change to new Configuration

<Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="\d+\.\d+\.\d+\.\d+" />

This will allow access to manager remotely from all IP addresses for login . Further you won't get 403 access denied page

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