Jul 23, 2015

Run Jetty or Tomcat on port 80 with AUTHBIND as Non-Root User in Ubuntu

1. If you have anything using port 80/443 already, you'll have to remove it. Ngnix, apache 2 can be run on port 80

2. install authbind (i.e. sudo apt-get install authbind)

3. Bind your ports to your dedicated Jira user with touch, chown and chmod. Here's port 80:
sudo touch /etc/authbind/byport/80
sudo chown abimaran:abimaran /etc/authbind/byport/80
sudo chmod 755 /etc/authbind/byport/80

4. Change the port in start.ini inside the Jetty
## HTTP port to listen on

4. Start the Jetty with following option
authbind --deep $JAVA_HOME/bin/java -Djava.net.preferIPv4Stack=true -jar start.ini
Start the Tomcat with following
authbind --deep ./catalina.sh -Djava.net.preferIPv4Stack=true run