How do I find the value of $CATALINA_HOME?

Tomcat can tell you in several ways. Here’s the easiest: $ /path/to/catalina.sh version Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.29 Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.29 Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.29/temp Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home Using CLASSPATH: /usr/local/apache-tomcat-7.0.29/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.29/bin/tomcat-juli.jar Server version: Apache Tomcat/7.0.29 Server built: Jul 3 2012 11:31:52 Server number: 7.0.29.0 OS Name: Mac OS X OS Version: 10.7.4 Architecture: x86_64 JVM Version: 1.6.0_33-b03-424-11M3720 JVM … Read more

log4j2 specify relative path to tomcat home dir for FileAppender

I solved my own issue. For system properties you need to prefix variables with sys:. <FastFile name=”ALog” fileName=”${sys:catalina.home}/logs/test.log” immediateFlush=”true” append=”true”> <PatternLayout> <pattern>%d %p %c{1.} [%t] %m%n</pattern> </PatternLayout> </FastFile> Found it after re-reading this part of the documentation: http://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution

Tomcat is web server or application server? [closed]

Tomcat is a web server (can handle HTTP requests/responses) and web container (implements Java Servlet API, also called servletcontainer) in one. Some may call it an application server, but it is definitely not an fullfledged Java EE application server (it does not implement the whole Java EE API). See also: What exactly is Java EE? … Read more

How to run different apps on single Tomcat instance behind different ports?

I think you can configure that in you server.xml file and put 2 services : <Service name=”app1″> <Connector port=”8081″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app1″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service> <Service name=”app2″> <Connector port=”8082″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app2″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service>

403 Access Denied on Tomcat 8 Manager App without prompting for user/password

This may be work. Find the CATALINA_HOME/webapps/manager/META-INF/context.xml file and add the comment markers around the Valve. <Context antiResourceLocking=”false” privileged=”true” > <!– <Valve className=”org.apache.catalina.valves.RemoteAddrValve” allow=”127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1″ /> –> </Context> You can find more details at this page.

Get ServletContext in JAX-RS resource

Furthermore, @Resource annotation might not work. Try this @javax.ws.rs.core.Context ServletContext context; The injection doesn’t happen until you hit the service method public class MyService { @Context ServletContext context; public MyService() { print(“Constructor ” + context); // null here } @GET @Path(“/thing”) { print(“in wizard service ” + context); // available here

How to config Tomcat to serve images from an external folder outside webapps? [duplicate]

This is the way I did it and it worked fine for me. (done on Tomcat 7.x) Add a <context> to the tomcat/conf/server.xml file. Windows example: <Context docBase=”c:\Documents and Settings\The User\images” path=”/project/images” /> Linux example: <Context docBase=”/var/project/images” path=”/project/images” /> Like this (in context): <Server port=”8025″ shutdown=”SHUTDOWN”> … <Service name=”Catalina”> … <Engine defaultHost=”localhost” name=”Catalina”> … <Host … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)