Unfortunately, Tomcat's use of authbind is undocumented, making it a challenge to bind Tomcat 9 to port 80, when not running as root. I have tried the following on Ubuntu 16.04:
1) In server.xml, changing attribute port to 80 in <Connector>.
2) Installing authbind.
3) Adding AUTHBIND=yes to setenv.sh
4) Creating file /etc/authbind/byport/80 with 777 permissions and owner tomcat.
If I run startup.sh
as root, it works fine. But if I do it as unprivileged user "tomcat", the script displays "Tomcat started" with no error message. But the browser shows "Unable to connect".
If I run authbind startup.sh
, the result is the same. The lack of error message from the startup script leaves me in the dark as to the cause of the problem.
Possibly relevant info: tomcat was installed from zip file, not from repo.
Is there something else I'm overlooking about the tricks to make this work? This is sorely missing in the official docs.
Best Answer
Installing Tomcat from zip is ok.
I request you to follow below steps to configure authbind and run tomcat on 80, I am considering you have installed authbind and tomcat 9.
*considering tomcat9 as a non-root user for tomcat
One more solution to run tomcat on 80 is using iptables.
Please let me know if you have any doubt or query I could help with.
Thanks, Nishant