Koozali.org: home of the SME Server

help installing tomcat

Offline isotropic

  • *
  • 8
  • +0/-0
help installing tomcat
« on: July 18, 2025, 04:31:12 AM »
Good evening, gentlemen.
I'm Isotropic, from Brazil. And I came to ask: can anyone help me install Apache Tomcat?
I use SME version 10.1.
I'd like to install Tomcat version 9.x, but I always get an error. It runs at boot but stops shortly after.

Stopping ProtocolHandler http-nio-8080.

Thank you.

Offline ReetP

  • *
  • 3,957
  • +6/-0
Re: help installing tomcat
« Reply #1 on: July 18, 2025, 11:37:06 AM »
This is not a 5 minute job.

A start is here

https://linuxize.com/post/how-to-install-tomcat-9-on-centos-7/

You can follow the first parts down to the systemd unit file.

Create that and then you will need a dropin file as per this:

https://forums.koozali.org/index.php/topic,54569.msg286027.html#msg286027

THisis the important bit:

/etc/systemd/system/tomcat.service.d/51custom.conf

Code: [Select]
[Install]
WantedBy= sme-server.target


(You can do the same thing but put it in /usr/lib/systemd/system is you prefer)

You will need a key:

Code: [Select]
config set tomcat service status enabled access public
Probably a post-upgrade/reboot and see if the service is up:

Code: [Select]
systemctl status tomcat
After that then you need to look at access - you could use AllowHosts and TCPPort keys in the config above to open ports and limit access.

Note :

Quote
In most cases, when running Tomcat in a production environment, you will use a load balancer or reverse proxy . It’s a best practice to allow access to port 8080 only to your internal network.

This is only a VERY rough and untested guide - you will lneed to do a lot of reading, and I suggest you build a test VM and experiment on that before using it in production.

Note also - v11 is around the corner. Instructions would be similar though.



...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline isotropic

  • *
  • 8
  • +0/-0
Re: help installing tomcat
« Reply #2 on: July 19, 2025, 02:30:06 AM »
Good evening.
Coming back to thank you for your help.
I was able to install and configure Tomcat. It's running perfectly thanks to the support I received.
Thank you.
Best regards.

Offline ReetP

  • *
  • 3,957
  • +6/-0
Re: help installing tomcat
« Reply #3 on: July 19, 2025, 08:34:10 AM »
Cool!!
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline finnbentley

  • 1
  • +0/-0
Re: help installing tomcat
« Reply #4 on: July 24, 2025, 09:29:09 AM »
Good evening, gentlemen. io games
I'm Isotropic, from Brazil. And I came to ask: can anyone help me install Apache Tomcat?
I use SME version 10.1.
I'd like to install Tomcat version 9.x, but I always get an error. It runs at boot but stops shortly after.

Stopping ProtocolHandler http-nio-8080.

Thank you.


Add the following content to the file:
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=simple
User=tomcat
Group=tomcat
Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
Environment=CATALINA_HOME=/opt/tomcat9
Environment=CATALINA_BASE=/opt/tomcat9
ExecStart=/opt/tomcat9/bin/startup.sh
ExecStop=/opt/tomcat9/bin/shutdown.sh

[Install]
WantedBy=multi-user.target


Offline Jean-Philippe Pialasse

  • *
  • 2,915
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: help installing tomcat
« Reply #5 on: July 24, 2025, 11:21:48 AM »
Welcome here Finnbentley

Those suggestions you do are generic and not taking into account the specific architecture of SME.

we do not use multi-user.target.  Probably one of the rare linux of not using it.

also looking at the error is indeed that tomcat is missing the network when starting. so one of your suggestions is valid, however another specificity of SME 10 network is only available at network-online.target.

For the other suggestions in [Service] i do not use tomcat so i can not comment on it but would suggest to start with only minimal changes


hence, i would update the file this way first

/etc/systemd/system/tomcat.service.d/51custom.conf

Code: [Select]
[Unit]
After=network-online.target
[Install]
WantedBy=sme-server.target