Skip to main content
16 votes
Accepted

tomcat 8 will not start after initial install

I had the same problem, fixed it by: giving tomcat user ownership of the whole tomcat directory: cd /opt && sudo chown -R tomcat tomcat/ and commenting out below line in /etc/systemd/system/...
user2968675's user avatar
11 votes

Tomcat 7 not producing log output to catalina.out on RHEL7

Jamie's answer is correct that you can force rsyslog to log what's going on with tomcat. However, that doesn't answer why tomcat 7 on rhel 7 does not log to catalina.out. Or if it does, why does it ...
Sokel's user avatar
  • 1,964
10 votes
Accepted

NGINX not passing all request headers to Tomcat

Headers containing underscores are considered invalid by nginx, which is why it will not pass them by default. The behaviour can be overridden by the underscores_in_headers directive. For example: ...
Richard Smith's user avatar
9 votes

CentOS 7 httpd failed to make connection with backend

To fix this, first test by setting the boolean dynamically (not permanent yet): /usr/sbin/setsebool httpd_can_network_connect 1 If that works, you can set it so that the default policy is changed ...
Ramon R.'s user avatar
8 votes

Tomcat - How does the setenv.sh work?

No. startup.sh runs in a different process than the process from which you launch it. Specifically, when a shell script is launched it runs in a newly created subshell of the current shell. And while ...
B Layer's user avatar
  • 5,171
8 votes
Accepted

how to add multiple roles to an admin user in Apache tomcat 8?

You need to define the appropriate roles (see the documentation for the full list), and add them to the user's roles attribute, using a comma as the separator: <tomcat-users> <role ...
Stephen Kitt's user avatar
6 votes

Tomcat 7 not producing log output to catalina.out on RHEL7

Creating a new file /etc/rsyslog.d/tomcat.conf containing the next two lines did the trick for me: programname,contains,"server" /var/log/tomcat/catalina.out programname,contains,"server" ~ ...
Jamie De Palmenaer's user avatar
6 votes

Tomcat - How does the setenv.sh work?

The startup.sh script may be sourcing the setenv.sh file to get the variable's value, but if it does, the variable will only be set within the environment of the startup.sh script, not in your ...
Kusalananda's user avatar
  • 335k
6 votes
Accepted

logrotate not able to truncate catalina.out

The problem got resolved after changing the permissions of /etc/logrotate.d/tomcat file. Before: $ ls -lht /etc/logrotate.d/tomcat -rwxr-xr-x 1 root root 308 Apr 25 2018 /etc/logrotate.d/tomcat ...
pkgajulapalli's user avatar
5 votes

-bash: ./catalina.sh: No such file or directory

[site /home/public]$ cd $CATALINA_HOME/bin You should not blindly follow recipes via copy and paste. If you haven't set the CATALINA_HOME variable this will take you to /bin, which obviously (...
JdeBP's user avatar
  • 68.9k
5 votes

How can I remove everything except last n bytes from the file in Linux?

catalina.out should be mostly empty, meaning the application intercepts all errors and handles them itself, possibly logging them elsewhere as configured. But more often than not, nothing such is done ...
A.B's user avatar
  • 36.8k
4 votes

Tomcat logrotate error: tomcat:1 bad rotation count '7 compress missingok size 5M }'

Each configuration directive needs to be on its own line: /opt/tomcat9/logs/catalina.out { copytruncate daily rotate 7 compress missingok size 5M }
Stephen Kitt's user avatar
4 votes
Accepted

Java: what exactly does a headless install mean?

In the Java world, “headless” means “with no GUI”, where GUI is understood as a local UI (as opposed to a UI rendered on some remote system using HTML for example). So most server applications work ...
Stephen Kitt's user avatar
3 votes

How to upgrade tomcat8 server on ubuntu?

In a given Ubuntu release, software typically doesn’t get upgraded to newer upstream versions, it only gets security patches and fixes for serious bugs. In Tomcat’s case, Ubuntu 16.04 has 8.0.32 plus ...
Stephen Kitt's user avatar
3 votes
Accepted

Can't connect to Tomcat on port 8080 (port 80 works)

Finally worked it out. Usually when we order a dedicated server from our hosting provider we spec it with no firewall. However in this case (due to an admin error) they set it up with their basic ...
MrRichT's user avatar
  • 53
3 votes
Accepted

how can I schedule a custom script to run whenever I restart a service

I don't have tomcat, but it should be the same as for apache, which I tried as follows (you probably only need to replace httpd by tomcat everywhere). Simply create an new systemd httpd.service file ...
meuh's user avatar
  • 51.5k
3 votes

Using FreeBSD Ports & Packages, Installing Tomcat on FreeBSD 12 installs Java 8 rather than my already-installed Java 12

When pre-built binary packages don't meed your needs, it pays to consider ways to build what you need from source via FreeBSD's extensive ports system. Some FreeBSD ports support a make config target ...
Jim L.'s user avatar
  • 8,007
3 votes
Accepted

Tomcat unable to execute VBoxManage: NS_ERROR_FAILURE (0x80004005)

I had the same problems. I was affected by a systemd limitation. Inspect your systemd Tomcat service (with your exact version): sudo systemctl cat tomcat9.service # # Systemd unit file for Apache ...
Valerio Bozz's user avatar
2 votes
Accepted

Strange error logging in BBB

The error hints about a configuration file bbb_api_conf.jspmissing. Checking out the github of the project, that file can be found as it is: <%! // This is the security salt that must match the ...
Rui F Ribeiro's user avatar
2 votes

Starting Tomcat 8 on Raspbian - Job for tomcat8.service failed

I ran through your setup steps using my RPi 3 Model B, running PIXEL via Raspbian. Once you've installed tomcat8, systemctl needs to be made aware of the change: sudo systemctl daemon-reload Then, ...
Blake Neal's user avatar
2 votes
Accepted

How to install Apache Tomcat 8 on centos 7?

after you have installed java on your system, you need to do as i mention here: #mv apache-tomcat-7 /opt #useradd tomcat #chown -R tomcat:tomcat /opt/apache-tomcat-7 To Install tomcat you need to ...
Ali Golestan's user avatar
2 votes

Tomcat 8 limit size of Catalina.out

You may use logrotate to manage Catalina.out https://dzone.com/articles/how-rotate-tomcat-catalinaout
Alief Abd Halim's user avatar
2 votes
Accepted

Remove OpenJDK/JRE and installed Oracle JDK, now Tomcat fails

I'd suggest you a robust way of binding Tomcat to specific version of JDK. Under tomcat_location_dir/bin subdir you can find setenv.sh file. Modify it by adding line: JAVA_HOME=/path/to/desired/...
Tagwint's user avatar
  • 2,480
2 votes
Accepted

HTTPD using same port multiple times

I get the impression you know this already: since you’re running your Tomcat instances listening on the same IP address, you need to make sure that every single port that Tomcat uses is set up ...
Stephen Kitt's user avatar
2 votes

Linux Machine time mismatch with all other logs time

The timezone setting of your session is not necessarily the same as the system default timezone. If you set the TZ environment variable fo your session, make sure you set it in your application start-...
telcoM's user avatar
  • 97.2k
2 votes
Accepted

How to install Apache Tomcat 9 using apt-get?

Tomcat 9 isn’t available in the repositories (yet). Your best option is to install one of the binary distributions available from Apache.
Stephen Kitt's user avatar
2 votes

Tomcat startup.sh file works but starting tomcat.service does not

This question finally helped me out: https://stackoverflow.com/questions/34614710/why-is-systemd-stopping-service-immediately-after-it-is-started in /etc/systemd/system/tomcat.service I removed ...
Paul T Davies's user avatar
2 votes

Tomcat startup script output not available with piping (grep)

First thanks to @Zeitounator and @A.B for their comments! After some testing on different tomcat versions and digging deeper I've found, that indeed the issue is in have_tty being set to zero. Using ...
Juraj Martinka's user avatar
2 votes

Where does the systemctl Tasks (limit=) come from and can I temporarily change it?

Thanks all for the help. I increased the size of my server, as well as the memory allocated to my JVM, but that did not help. I had expected the Tasks limit to increase automatically upon reboot or ...
Jeff's user avatar
  • 41
2 votes

How can I remove everything except last n bytes from the file in Linux?

tail catalina.out > catalina.new rm catalina.out mv catalina.new catalina.out Then you have to restart or reload tomcat to append logs to new file (it still has opened file descriptor of old ...
Jan Marek's user avatar
  • 3,947

Only top scored, non community-wiki answers of a minimum length are eligible