Integração TomCat 6 + IIS 7
O Blog The Power of Java trouxe uma ótima solução para quem pretende integrar o TomCat ao IIS7. Seque abaixo os procedimentos.
Arquivos necessários:
Java Version JDK e JRE
http://java.sun.com/javase/downloads/index.jsp
Apache Tomcat
http://tomcat.apache.org/download-60.cgi
Tomcat Connectors (mod_jk)
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.28/
Após ter feito o download, instale o JDK na pasta C:\Java\JDK e o JRE no diretório C:\Java\JRE.
Em seguida execute o instalador do TomCat 6 selecione as opções a seguir:
Mude o diretorio de instalação para C:\TomCat e na hora de escolher o JRE informe o diretório onde foi isntalado o JRE em C:\Java\JRE, finalize a instação.
Feito isso temos de setar as variáveis de ambiente para que o tomcat rode:
CATALINA_HOME = C:\TomCat
JAVA_HOME = C:\Java\JDK
No path inclua o caminho %CATALINA_HOME%/bin e %JAVA_HOME%/bin, tente executar o TomCat se o mesmo não iniciar copie a msvcr71.dll da pasta C:\Java\JDK\bin para o diretório C:\TomCat\bin, e tente novamente que deve funcionar.
Agora crie uma pasta ISAPI em C:\TomCat\ e copie isapi_redirect-1.2.28.dll do conector para dentro dela e renomeie para isapi_redirect.dll.
Crie um arquivo isapi_redirect.properties dentro da pasta C:\TomCat\ISAPI igual ao modelo:
#Configuration file for the Jakarta ISAPI Redirector
#The path to the ISAPI Redirector Extension, relative to the website
#This must be is a virtual directory with execute privileges
extension_uri=/jakarta/isapi_redirect.dll
#Full path to the log file for the ISAP Redirector
log_file=c:\tomcat\logs\isapi_redirect.log
#Log level (debug, info, warn, error or trace)
log_level=info
#Full path to the workers.properties file
worker_file=c:\tomcat\conf\workers.properties
#Full path to the uriworkermap.properties file
worker_mount_file=c:\tomcat\conf\uriworkermap.properties
Crie mais esse dois arquivos dentro da pasta C:\TomCat\conf
uriworkermap.properties
#uriworkermap.properties – IIS
#
#This file provides sample mappings for example wlb
#worker defined in workermap.properties.minimal
#The general syntax for this file is:
#[URL]=[Worker name]
/admin/*=wlb
/manager/*=wlb
/examples/*=wlb
#Optionally filter out all .jpeg files inside that context
#For no mapping the url has to start with exclamation (!)
#!/servlets-examples/*.jpeg=wlb
#
#Mount jkstatus to /jkmanager
#For production servers you will need to
#Secure the access to the /jkmanager url
#
/jkmanager=jkstatus
workers.properties
#workers.properties.minimal –
#
#This file provides minimal jk configuration properties needed to
#connect to Tomcat.
#
#The workers that jk should create and work with
#
worker.list=wlb,jkstatus
#Defining a worker named ajp13w and of type ajp13
#Note that the name and the type do not have to match.
#
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
#
#Defining a load balancer
#
worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w
#Define status worker
worker.jkstatus.type=status
Como configurar o IIS 7
Crie um diretório virtual
Vamos dar permissões para a execução dessa .dll
Vamos editar as permissões click em Edit Feature Permissions
Agora verifique se o ISAPI .dll esta ativo
Vamos agora configurar o filtro
Click em add
Vamos liberar as restrições
Click em Add
Agora de um restart no servidor IIS e faça um teste no navegador.
Endereço:
http://localhost:8080/examples/servelets/servelet/HelloWorldExample
Agora com o redirecionamento:
Endereço:
http://localhost/examples/servelets/servelet/HelloWorldExample
Post Original em:
http://poweredbyjava.blogspot.com/2010/01/integracao-tomcat-6-x86-iis-7.html
Nenhum Comentário
Nenhum comentário ainda.
RSS feed for comments on this post. TrackBack URI