Apache 2 and Tomcat installation

From Plex-XML

Jump to: navigation, search
  • Apache 2.2.8
  • Tomcat 6.0.16
  • mod_jk 1.2.26

mod_jk

mod_jk is a replacement to the elderly mod_jserv. It is a completely new Tomcat-Apache plug-in that handles the communication between Tomcat and Apache.


http://ploin.de/robertReiz/blogShow.action?tag=Tomcat&start=10&blogId=12

# Tomcat and Java configuration
#
workers.tomcat_home=d:/Apache/Tomcat8080/
workers.tomcat_home=d:/Apache/Tomcat8180/
workers.java_home=d:/java//opt/java/jre15/
ps=/

worker.list=tomcat8080
worker.list=tomcat8180

# Definition for local worker using AJP 1.3
#
worker.tomcat8080.type=ajp13
worker.tomcat8080.port=8009
worker.tomcat8080.cachesize=20

worker.tomcat8180.type=ajp13
worker.tomcat8180.port=8010
worker.tomcat8180.cachesize=20
  • in server.xml jvmRoute zufügen: <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat8080">
  • in apache config
<IfModule jk_module>
  # Where to find workers.properties
  # Update this path to match your conf directory location (put workers.properties next to httpd.conf)
    JkWorkersFile conf/workers.properties

  # Set the jk log level [debug/error/info]
    JkLogLevel    info
  # Select the timestamp log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

    JkOptions +ForwardKeySize
    JkOptions +ForwardURICompat
    JkOptions -ForwardDirectories

    JkMount  /manager/html/* tomcat8080
    JkMount  /manager/html tomcat8080

    JkMount  /LogMan/* tomcat8080
    JkMount  /LogMan tomcat8080

    JkMount  /manager/html/* tomcat8180
    JkMount  /manager/html tomcat8180

</IfModule>
  • If you have installed a second Tomcat it will need to use other ports in the server.xml Defaults are
    • 1.: 8080, 8005, 8443, 8009
    • 2.: 8180, 8006, 8444, 8010
    • 3.: 8280, 8007, 8445, 8011
  • Servcie installation using service.bat (only included in the .zip installation)
    • service install tomcat8080 or service remove
  • Virtual Hosts
    • redirect a virtual host to a Tomcat context
<VirtualHost *:80>
  ServerName virtual.example.com
  Redirect /index.html http://virtual.example.com/tomcatcontext/
  JkMount /tomcatcontext/* tomcat8080
</VirtualHost>
Personal tools