Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk - Page 4
|
Configure Apache Important note: Be sure to make a copy of your config files before modifying.
Otherwise, if you are not using ISPConfig and your Vhosts are defined within your main Apache2 config file, you just need to add this code there within the desired Vhosts that you want to utilize Tomcat (JSP/Servlets).
If you are not running Vhosts, simply add this code at the bottom of your main Apache2 config file.
For those running ISPConfig as I am, you will need to either manually place this code in the master Vhost (localhost) in the /etc/apache2/vhosts/Vhosts_ispconfig.conf or the selected Vhosts that you want to utilize Tomcat (JSP/Servlets) using the ISPConfig control panel—in the Apache Directives window for each website.
This is up to you.
For this server, I have the ISPConfig Vhosts defined in /etc/apache2/vhosts/Vhosts_ispconfig.conf. You can either place this code after the <VirtualHost ipaddress:port> tag or just before the </VirtualHost> end tag. ISPConfig documentation recommends that you use the control panel to include any additional virtual host directives.
Conclusion
To finalize and test this configuration you will need to copy the Tomcat example JSP files to the virtual host web directory that was defined in the server.xml, apache2.conf, and Vhosts_ispconfig.conf files. In the server.xml file you will notice that I am referencing the jsp-examples directory where jsp-examples is the name of the docbase. This will give you some idea of how the web applications will be setup for your website. You can find more details on the Tomcat website on how to generate your original web applications. In order to define another web application, you would need to define another worker (i.e. worker2) in the workers.properties file, add another host in the server.xml file, and add the same directives (using worker2 of course) to the respective VHost section.
You should see the same jsp-examples html as you did in the default Tomcat page from earlier.
Congratulations! Your server should now be ready to support JSP/Servlets. Again, if you find any inconsistencies within this tutorial, please contact me so I can make the appropriate corrections.
Resources/Links This tutorial was compiled using several resources that I found on the internet. Due to the trouble I had finding all of this information it only made sense to put it all together. http://blog.gilluminate.com/?s=10 Integrating Tomcat and Apache on Red Hat Linux http://tomcat.apache.org/connectors-doc-archive/jk2/jk2/vhosthowto.html http://tomcat.apache.org/connectors-doc/howto/apache.html The Perfect Setup - Debian Sarge (3.1) http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/
|




print: 
Recent comments
3 hours 1 min ago
4 hours 1 min ago
6 hours 45 min ago
7 hours 11 min ago
7 hours 42 min ago
8 hours 31 min ago
8 hours 53 min ago
9 hours 36 min ago
10 hours 57 min ago
11 hours 26 min ago