M
M
Mihis2019-05-20 23:31:17
tomcat
Mihis, 2019-05-20 23:31:17

How to fix Tomcat ports?

I changed the ports in the "server.xml" file from 8080 and 8443 to 80 and 443, but after that the server does not respond on either the old port or the new one. How to make ports 80 and 443 work?
I found an error in the logs:

20-May-2019 16:21:31.931 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-80]]
        org.apache.catalina.LifecycleException: Protocol handler initialization failed
                at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.core.StandardService.initInternal(StandardService.java:533)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1059)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
                at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
                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.load(Bootstrap.java:304)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)
        Caused by: java.net.SocketException: Permission denied
                at sun.nio.ch.Net.bind0(Native Method)
                at sun.nio.ch.Net.bind(Net.java:433)
                at sun.nio.ch.Net.bind(Net.java:425)
                at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
                at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
                at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:248)
                at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:222)
                at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1119)
                at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1132)
                at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:557)
                at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
                at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)
                ... 13 more

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2019-05-20
@Mihis

ports < 1000 require root, which is what it tells you,
well, look, it may already be busy with some other process
doing tomcat root / wheel group or sudoer is probably wrong

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question