Today, I tried to move my Tomcat server from 8080/8443 to 80/443. After changing my Tomcat config I restarted the daemon and the log spewed out exceptions about not having permissions to bind to 80 and 443. Example:
This is to be expected as ports below 1024 are priviledged ports. There are a number of solutions to this problem but I opted to go with the solution of using authbind.
Following instructions such as these, Tomcat still didn't fire up and authbind seemed unable to solve my problem.
I eventually realized it was the way Gentoo handles config files and init scripts and that the common instructions online would not apply.
After some help from one of our local Gentoo guys, we solved the problem in with the following way for Gentoo.
Authbind doesn't play nice with IPv6, so we need to tell java to prefer it. Edit '/etc/conf.d/tomcat-7-main':
And finally, tell the Gentoo init script to use authbind and allow child processes to also have the same permission. Edit '/etc/init.d/tomcat-7-main' and change:
Now Tomcat should fire up: