go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Who should go online first, Apache httpd or Tomcat?
 
Subject: Who should go online first, Apache httpd or Tomcat?
Author: Linux
In response to: Configure Apache mod_jk
Posted on: 10/26/2011 12:52:23 AM

Always start or restart Tomcat first, then Apache httpd.
 

> On 10/21/2011 01:57:12 AM Linux wrote:


1. Configure connector
$ sudo vi /etc/httpd/conf/workers.properties

 # Define the list of workers that will be used
 worker.list=worker1

 # Define worker1
 worker.worker1.port=8009
 worker.worker1.host=localhost
 worker.worker1.type=ajp13	

Save and close the file.

2. Configure httpd
# Load mod_jk module
LoadModule    jk_module  /usr/lib/httpd/modules/mod_jk.so

# Where to find workers.properties
JkWorkersFile /etc/httpd/conf/workers.properties

# Where to put jk shared memory
JkShmFile     /var/log/httpd/mod_jk.shm

# Where to put jk logs
JkLogFile     /var/log/httpd/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel    info

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send servlet for context /examples to worker named worker1
JkMount  /examples/servlets/* worker1
# Exclude the static files                      
JkUnMount /examples/servlets/*.jpg  worker1
JkUnMount /examples/servlets/*.gif  worker1

# Send JSPs  for context /examples to worker named worker1
JkMount  /examples/*.jsp worker1


3. Configure httpd -- VirtualHost
<VirtualHost *:80>
  ServerName example2.com
  ServerAlias www.example2.com
  DocumentRoot /home/ec2-user/example2.com/html
  SuexecUserGroup ec2-user ec2-user

  <Directory /home/ec2-user/example2.com/html>
    Options Indexes Includes FollowSymLinks
    AllowOverride All
  </Directory>

# Send servlet for context /examples to worker named worker1
JkMount  /examples/servlets/* worker1

# Send JSPs  for context /examples to worker named worker1
JkMount  /examples/*.jsp worker1

</VirtualHost>





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.