- Tomcat
http://www.ramkitech.com/
http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html
http://my.opera.com/shibutani/blog/show.dml/1779612
http://www.scribd.com/doc/7571690/Java-Security-Como-Usar-JAAS-Com-Tomcat-6
http://www.mhavila.com.br/topicos/java/tomcat.html#t10
-
With o Apache
http://www.ramkitech.com/2012/10/tomcat-clustering-series-simple-load.html
http://www.ntu.edu.sg/home/ehchua/programming/howto/ApachePlusTomcat_HowTo.html
http://www.ntu.edu.sg/home/ehchua/programming/howto/images/ApachePlusTomcat.png
http://www.ntu.edu.sg/home/ehchua/programming/howto/images/HTTP_ClientServerSystem.png
-
Why integrate Tomcat with Apache?
-
Clustering and loadbalance: With Apache you can use multiple tomcat instances
or divide Tomcat instances into various namespaces
-
Security:
-
Speed for static content
-
Context Containers
Context
containers are web applications running inside the webapps. A web site can have one or more contexts.
-
To run
-
Apache needs to load a adpter module which uses
Apache JServ Protocol (AJP) to comunicate with Tomcat via another TCP
port (8009)
-
When Apache receives an HTTP request:
-
Apache checkes if the request belongs to Apache, Tomcat, PHP, etc
-
If Tomcat, Adapter takes the request and forwards it to Tomcat.
-
Steps
-
Install Apache HTTP Server
-
Install Tomcat
-
tomcat.apache.org (-> Download -> Tomcat Connectors -> JK 1.2 ->
Binary Releases -> windows ->
tomcat-connectors-1.2.37-windows-i386-httpd-2.4.x.zip .
-
rename it to mod_jk and copy to %APACHE%/modules
-
create a file mod_jk.conf in %APACHE%/conf
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: # Load mod_jk module
2: # Update this path to match your modules location
3: LoadModule jk_module modules/mod_jk.so
4: # Where to find workers.properties
5: # Update this path to match your conf directory location
6: JkWorkersFile C:/workspace/linguagens/java/servers/apache-tomcat-7.0.16/conf/workers.properties
7: # Where to put jk logs
8: # Update this path to match your logs directory location
9: JkLogFile C:/workspace/linguagens/java/servers/apache-tomcat-7.0.16/logs/mod_jk.log
10: # Set the jk log level [debug/error/info]
11: JkLogLevel info
12: # Select the log format
13: JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
14: # JkOptions indicate to send SSL KEY SIZE,
15: JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
16: # JkRequestLogFormat set the request format
17: JkRequestLogFormat "%w %V %T"
18: # Send everything for context /ws to worker ajp13
19: JkMount /ws ajp13
20: JkMount /ws/* ajp13
21: # Send everything for context /examples to worker ajp13
22: JkMount /examples ajp13
23: JkMount /examples/* ajp13
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: # Load mod_jk module
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: # Define 1 real worker named ajp13
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: <Context path="/projeto" docBase="projeto" debug="0" reloadable="true" />
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: <taglib>
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: <?xml version=”1.0? encoding=”UTF-8??>
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: <resource-ref>
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: import java.sql.Connection;
1: <Connector protocol="org.apache.coyote.http11.Http11Protocol"
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: <Server>
pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzzEJp2SQgJFiQHhhbW4dhQaxkq_ERbbLnrl3VfITc4J-kmYntj7im7MhAk7re85G59bEsJCE0eoHznoKmPoWI_MBphUm1MuwBJK-Rm2pOvHyEu5GOS0RxC88inwC1ag_hnx25IL6Pruh/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}
1: <Connector port="8080"
Nenhum comentário:
Postar um comentário