Tenho cerca de 100 hosts virtuais da Railo que não são mais iniciados. No início, novos sites estavam tendo esse comportamento agora todos eles fazem. Todos os alias virtuais apenas abrem o contexto padrão do railo! Isso costumava funcionar. meus arquivos conf / Catalina / www.example.com / ROOT.xml são todos assim:
<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/www/example/site">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
Meu server.xml
; Eu tentei desativar o mod_cfml, mas isso parece ter piorado (nenhum site está carregando):
<?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>
Quando o servidor é iniciado, apenas o contexto 'localhost' é implantado:
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
Embora eu use o conector AJP do apache, esse comportamento persiste mesmo se eu for diretamente para example.com:8888
. Alguma idéia do que pode fazer com que o Tomcat ignore basicamente meus virtualhosts?
BTW: O que funciona é adicionar o host a server.xml
, mas me disseram que esta é uma má idéia e eu não quero fazer isso, já que preciso implantar sites sem reiniciar o servidor:
<Host name="example.com" appBase="webapps">
<Context path="" docBase="/www/example/site" />
<Alias>*.example.com</Alias>
</Host>
A única diferença real que posso ver é que meus arquivos externos ROOT.xml não declaram appBase
ou path
. Eles deveriam? Eu não acho que exista algum lugar no ROOT.xml para colocar o appBase.
EDIT: devo corrigir essa última parte. O aplicativo DEPLOYED (depois que eu deletei o seu WEB-INF), mas o servidor ainda me mostra o site errado quando eu vou a URL na porta 80 ou 8888.