Chapter 15: Shared Tomcat Hosting As explained in the section Name-Based Virtual Hosting with Apache, earlier in this chapter, for every virtual host definition you need to add a section in Apache (in fact, the Tomcat configuration definition is very similar to this concept). Now, along with the rest of the virtual host contents, you add some directives to connect certain resources to Tomcat. Modify httpd.conf s elements as follows: Listen 80 … # Load the mod_jk module LoadModule jk_module modules/mod_jk.so # Path to workers.properties file JkWorkersFile /etc/httpd/conf/workers.properties # Path to jk shared memory JkShmFile /var/log/httpd/mod_jk.shm # Path to jk log file 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] … NameVirtualHost 192.168.1.2 ServerName callisto.dom DocumentRoot /home/websites/callisto.dom/web ServerAdmin support@callisto.dom ErrorLog /home/websites/callisto.dom/log/error TransferLog /home/websites/callisto.dom/log/access JkMount /*.jsp callisto-worker ServerName europa.dom DocumentRoot /home/websites/europa.dom/web ServerAdmin support@europa.dom ErrorLog /home/websites/europa.dom/log/error TransferLog /home/websites/europa.dom/log/access JkMount /*.jsp europa-worker The highlighted portions in the httpd.conffile show the common mod_jksettings (path to log file, shared memory file, workers.propertiesfile, and so on) as well as the settings specific to each virtual host. These virtual host specific settings include the JkMount directive that specifies which worker handles JSP pages for each virtual host. The workers.propertiesfile consists of the following: # Define all the workers worker.list=europa-worker, callisto-worker # Set properties for callisto-worker worker.callisto-worker.type=ajp13 worker.callisto-worker.host=callisto.dom worker.callisto-worker.port=8009 (continued)
For high quality website hosting services please check tomcat web hosting website.
This entry was posted
on Thursday, October 1st, 2009 at 10:02 am and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.