Fix java.net.BindException:Permission denied <null>:80 error in Tomcat launcher under Mac OS X

Source: Internet
Author: User

When I started Tomcat on Mac OS X, I reported java.net.BindException:Permission denied <null>:80,java.net.bindexception:permission Denied <null>:443 error, 443 because I want to abandon the SSL service.

Mac OS X requires root privileges to bind to ports below 1024, but if you start eclipse or Tomcat with root, the various files that are created by the startup are root and cannot be deleted by ordinary users.

To do this, we can do the network layer port forwarding through PFCTL, so that the connection to the native 80 port of the request, are forwarded to 9090 port; (Note that Mac OS uses 80 ports for network file sharing, which is to be shut down first).

1, modify the/etc/pf.conf, use sudo vim/etc/pf.conf open
2. add rdr on Lo0 inet Proto TCP from all to 127.0.0.1 port, 127.0.0.1 port 8080, rdr on Lo0 inet Proto TCP from all to 127.0.0.1 port 443, 127.0.0.1 Port 8443 to the pf.conf file Rdr-anchor "com.apple/*" after the line. pf.conf is a strong requirement for order, so pay attention to the order in which the content is added. Lo0 through ifconfig see oneself that device binds is 127.0.0.1, Lo0 is the name of this network device. This does not move, direct use.

3, Modify the pf.conf after the execution of the command, let port forwarding effective:

sudo pfctl-d

sudo pfctl-f/etc/pf.conf

sudo pfctl-e

Do the above configuration, your local access to port 80 will jump to 8080,443 jump to 8443,8080,8443 this port you decide.

Troubleshoot the Tomcat launcher Java.net.BindException:Permission denied <null>:80 error in Mac OS X

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.