I have about 100 Railo virtualhosts that won't start anymore. At first new sites were having this behaviour now they all do. All virtual aliases just open the railo default context! This used to work. my conf/Catalina/www.example.com/ROOT.xml files are all like this:
<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/www/example/site">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
My server.xml
; I tried disabling mod_cfml but that seems to have made things worse (no sites are loading):
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Service name="Catalina">
<Connector port="8888" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="127.0.0.1">
<Host name="127.0.0.1" appBase="webapps"
unpackWARs="false" autoDeploy="false">
<!--
<Valve className="mod_cfml.core"
loggingEnabled="true"
waitForContext="20"
maxContexts="200"
timeBetweenContexts="30000"
/>
-->
</Host>
</Engine>
</Service>
</Server>
When the server starts, only the 'localhost' context deploys:
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib
Jun 11, 2015 6:24:29 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8888"]
Jun 11, 2015 6:24:29 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 11, 2015 6:24:29 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 813 ms
Jun 11, 2015 6:24:29 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 11, 2015 6:24:29 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Jun 11, 2015 6:24:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/railo4/tomcat/webapps/ROOT
Jun 11, 2015 6:24:46 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [4,498] milliseconds.
railo-server-root:/opt/railo4/lib/railo-server
===================================================================
SERVER CONTEXT
-------------------------------------------------------------------
- config:/opt/railo4/lib/railo-server/context
- loader-version:4.3
===================================================================
Thu Jun 11 18:24:47 EST 2015-653 using JRE Date Library
Thu Jun 11 18:24:48 EST 2015-640 Start CFML Controller
Thu Jun 11 18:24:48 EST 2015 Loaded Railo Version 4.2.1.000
===================================================================
WEB CONTEXT (31c16faa5d8574b34b11678a3cb74b43)
-------------------------------------------------------------------
- config:/opt/railo4/tomcat/webapps/ROOT/WEB-INF/railo
- webroot:/opt/railo4/tomcat/webapps/ROOT/
- hash:31c16faa5d8574b34b11678a3cb74b43
- label:31c16faa5d8574b34b11678a3cb74b43
===================================================================
Jun 11, 2015 6:24:48 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/railo4/tomcat/webapps/ROOT has finished in 19,750 ms
Jun 11, 2015 6:24:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8888"]
Jun 11, 2015 6:24:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 11, 2015 6:24:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 19795 ms
Although I use the AJP connector from apache this behaviour persists even if I go directly to example.com:8888
. Any ideas what might cause Tomcat to basically ignore my virtualhosts?
BTW: What DOES work is adding the host to server.xml
, However I'm told this is a bad idea and I don't want to do it as I need to deploy sites without server restarts:
<Host name="example.com" appBase="webapps">
<Context path="" docBase="/www/example/site" />
<Alias>*.example.com</Alias>
</Host>
The only real difference I can see is that my external ROOT.xml files don't declare appBase
or path
. Are they supposed to? I don't think there's anywhere in the ROOT.xml to even put appBase.
EDIT: I must correct that last part. The app DEPLOYED (after I deleted its WEB-INF) but server still shows me the wrong site when I go the the URL on port 80 or 8888.