Can't upload war file through tomcat manager dashboard with VPN

I have configured server and deployed war file earlier. All of those I did in Digital Ocean's CentOS server. Now I need to configure CentOS server In Local Data Center. I have configured Tomcat as usual way. Tomcat is running. I can access tomcat manager dashboard. Problem is when I am trying to deploy war file I am getting error. This is the dashboard of tomcat manager.

enter image description here

But when I hit deploy I am getting connection error.

enter image description here

Note that, I had to access provided IP address with VPN. Because it was a requirement to access this IP with VPN.

As I am getting error in 80 port I changed tomcat port to 8080. Then I traced server and Get this error

java.net.BindException: Address already in use (Bind failed)
       at java.net.PlainSocketImpl.socketBind(Native Method)
       at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
       at java.net.ServerSocket.bind(ServerSocket.java:375)
       at java.net.ServerSocket.<init>(ServerSocket.java:237)
       at org.apache.catalina.core.StandardServer.await(StandardServer.java:440)
       at org.apache.catalina.startup.Catalina.await(Catalina.java:775)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:721)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)

Also getting this error

17-Feb-2019 17:18:59.396 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
17-Feb-2019 17:18:59.396 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
17-Feb-2019 17:18:59.396 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
17-Feb-2019 17:18:59.426 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
17-Feb-2019 17:18:59.426 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
17-Feb-2019 17:18:59.426 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
17-Feb-2019 17:18:59.427 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]

Any help will be appreciated!!


Solution 1:

I was deploying someother .war file in tomcat 8. To successfully deploy change the max upload and max request. Open tomcat installation directory then edit Tomcat 8.0/webapps/manager/WEB-INF/web.xml in a text editor and find the lines with the text: <max-file-size> and <max-request-size>. Increase its value. Ex:

<max-file-size>100428800</max-file-size>
<max-request-size>100428800</max-request-size>

This worked for me.