Skip to main content
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
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
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,201
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
  • 341k
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
  • 69.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
  • 37.5k
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

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,322
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
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

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

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
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,490
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

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
  • 102k
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,997
2 votes

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

Instead of treating the symptom, treat the disease. As others have mentioned, "proper logging" will save you from this. But proper logging involves the development team, a develop-test-...
Christopher Schultz's user avatar
2 votes

Java: what exactly does a headless install mean?

The headless is some weird term (and I hope becoming obsolete) to describe a system without keyboard and screen. For Java, it means it will not have support for GUI interface, which it is a ...
Giacomo Catenazzi's user avatar
1 vote

SELinux blocks tomcat web application to load Java native library (JNI) from /tmp folder

I think you forgot to run restorecon after defining the fcontext: $ semanage fcontext -a -t tomcat_tmp_t "/tmp/app_*(/.*)?" $ restorecon -rv /tmp References https://noobient.com/post/165972214381/...
slm's user avatar
  • 373k
1 vote

Accessing different servers with same domain name

As an architectural solution, which is very dependent of the particular application you've got, I'd suggest you consider something like this: Set up DNS so that your canonical website name points to ...
Chris Davies's user avatar
1 vote

Logrotate Tomcat log file

According to this documentation you should keep the rotatable option as true (default) so that it does not write always to the same file. Also you can format the filename string to a fixed value, so ...
Zip's user avatar
  • 1,032

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