Hot answers tagged

24

Add the missing trailing slash to your ProxyPass and ProxyPassReverse directives: ProxyPass / ajp://server.ip.addr:8013/ ProxyPassReverse / ajp://server.ip.addr:8013/


16

The SyslogIdentifier directive allows you to set the name of the executable name in the logs. SyslogIdentifier=java # or my app name, but not both! SyslogIdentifier=myapp


16

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/tomcat.service: Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'


10

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 log to both catalina.out and a catalina with a date (if you are not using an RPM install). First, in the past around 7.0.42, Red Hat's scripts used catalina.out ...


6

The read system call reads some bytes from an open file. The “odd string” is the bytes that are read by the call. This call attempts to read 32 bytes (third parameter), and succeeds (return value), from file descriptor 34. To find out what file your application is reading for, look back in the trace for the system call that opens this file descriptor. This ...


6

I think you're simply confused by the broken punctuation on that page. The _ and [ are remnants of some markup, they aren't part of the iptables syntax. Also the | character cannot be used to separate IPs, you need to use , (comma). /sbin/iptables -t nat -A OUTPUT -p tcp -d 54.224.121.116,54.224.121.116 --dport 80 -j REDIRECT --to-port 8080


6

Try prefixing the command with nohup, as in sudo nohup /usr/local/tomcat/bin/startup.sh.


6

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" ~ Afterwards restart your rsyslog daemon: service rsyslog restart


6

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 rolename="admin-gui"/> <role rolename="manager-gui"/> <role rolename="manager-status"/> <user username="tomcat" password="pass1234" ...


5

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: underscores_in_headers on; See this document for more.


5

No. startup.sh runs in a different process than the process from which you launch it. When a script is launched it runs in a new subshell of the current shell. And while it's true that a subshell inherits the environment of its parent during initialization there is no propagation of changes, in either direction, after that time. So when startup.sh does . ...


5

No. 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 you interactive shell. If you want to see what's happening when you run startup.sh, first determine what shell interpreter it's using (see the #!-line at the top of ...


5

[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 (because it is an operating system directory) is not where Tomcat is installed on FreeBSD. If tomcat 8 is installed from packages/ports and configured for you, the ...


4

Note: $CATALINA_HOME is where Tomcat is installed. If the application is a WAR file, just drop it in $CATALINA_HOME/webapps and TC will automatically create the web app for you. If you have all of the contents of the application, you must distribute as so: The root path of your application: $CATALINA_HOME/webapps/newfolder Define your web.xml file here: $...


4

Finally found the right configuration file my self. It is /etc/default/tomcat. There I was able to set JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 and it works now. Thanks for the help.


4

I found these slightly different steps which may help you out. Install authbind Make port 80 available to authbind (you need to be root): $ sudo touch /etc/authbind/byport/80 $ sudo chmod 500 /etc/authbind/byport/80 $ sudo chown glassfish /etc/authbind/byport/80 Make IPv4 the default (authbind does not currently support IPv6). To do so, create the file ...


4

Log management is messy enough without random little scripts copying things around, maybe getting all the data in a timely manner or maybe not. Really if you want to have centralized logging, you should have centralized logging and not little kludges hidden around for someone to forget about and then have to support after someone has quit. Do it right ...


4

Append a / to both your ProxyPass lines as it seems that tomcat is redirecting to login instead of /login. Use: ProxyPass / ajp://server.ip.address:8009/ ProxyPassReverse / ajp://server.ip.address:8009/


4

Replace "discription" by "description:" (typo and missing colon). RHEL 5 needs "chkconfig:" and "description:", RHEL6 only "chkconfig:".


4

You have two different selections: lsof -u tomcat7 lists open files belonging to tomcat7, whatever their names. lsof | grep tomcat7 lists open files with tomcat7 in their name ( or as a string in the line, be it user or group) irrespective of their owners.


3

The answer lies in -i eth0. Even though you have httpd set to connect to 17.98.65.28, which I assume is an IP on eth0, the traffic won't actually flow over eth0, it'll use lo instead. The reason for this is that when routing to any IP the box has on itself, that traffic flows over lo. You can verify this with the following: ip route get 17.98.65.28 You ...


3

Try: java -XX:+PrintFlagsFinal And looking for value you want. In my machine, output is: uintx MaxHeapSize := 1570766848 {product} uintx MaxNewSize = 18446744073709486080{product} uintx MaxPermHeapExpansion = 5439488 {product} ...


3

Check the ownership of the PID file, that's a dead giveaway.


3

You can proxy the requests from Apache to Tomcat as described in http://tomcat.apache.org/tomcat-8.0-doc/proxy-howto.html. Basically you need something like this in your apache config: ProxyPass /myapp http://localhost:8081/myapp ProxyPassReverse /myapp http://localhost:8081/myapp The same method should work too with Rails as long as you access ...


3

The 'general' approach would be $ sudo update-rc.d -f servicename remove to remove the servicename from any runlevel to start automatically. To re-enable the defaults, do $ sudo update-rc.d servicename defaults


3

You could use sysv-rc-conf to manage runlevels (configure which services are supposed to be started at which runlevels). It is quite simple: Install it: sudo apt-get install sysv-rc-conf Run it: sudo sysv-rc-conf Mark your service to be started on desired runlevels (2, 3, 4 and 5 are regular boot, 0 is shutdown, 6 is reboot). Use keyboard arrows to ...


3

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 and this setting will persist across reboots: /usr/sbin/setsebool -P httpd_can_network_connect 1 Credit: https://web.archive.org/web/20190313023936/http://...


3

In case the comments to the question were not clear enough, I am adding an answer here, along with a few Pointers not mentioned in those comments. "Why doesn't Tomcat doesn't show up when I grep netstat's output for 8080 ?" Short Answer : Because Port Number 8080 is getting converted to string http_alt, which will not match the grep pattern. Details : From ...


3

This isn't quite as simple as using apt-get, but the result will be the same. If you download the packages for Tomcat 7.0.62 from Ubuntu, they should install fine in elementary OS and support Java 8. You'll need to click on the little triangle to the left of "The Wily Werewolf", and download the .deb files you need: at least libservlet3.0-java, libtomcat7-...


3

The environment variable you should set is called 'CATALINA_OPTS'. Here is an example in the tomcat documentation, which is also related to monitoring: Apache Tomcat 7 - Monitoring and Managing Tomcat


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