0

im running tomcat on my ubuntu 18.04 headless server as root. Like in apache or nginx you can start a service as non-root with systemd and only root will start the master process to bind the ports 80 & 443. So i will using the same start process like apache&nginx for my tomcat. After adding user and group as tomcat (no superuser) and create tomcat.service, what i need config too ???

i would be very thankfull if somebody cans helps me out.

blackbeard

beard black
  • 67
  • 2
  • 14

1 Answers1

1

The most of the services is configured as default on the port >1024. There is several reasons for that...

The way you are trying to focus is possible but it may cause some future steps requiring (at least for a while a root access to do the changes)... But I cannot say it would be wrong ;).

Please don't down vote me for the alternative solution (as it is not directly the answer for the question). What about keep service on default >1024 port and setup reverse proxy (haproxy, nginx, apache http, etc. - whatever you are familiar with) to accept the connection on 80 and / or 443 and conditionally (SNI) or unconditionally proxy the traffic to application default port? The side effect would be that you can "share" 80/443 between more services on the host.

Kamil J
  • 1,632
  • 1
  • 5
  • 10
  • its a stable to run tomcat, reverse proxy and mysql on the same server ? – beard black Jan 23 '20 at 11:30
  • Depends on load. In general yes but in case of high load i would think abut moving db out... with normal small-medium app it may be ok. – Kamil J Jan 23 '20 at 12:07