|
|
|||||||||||||||
|
Getting Tomcat and Cocoon running on virtual hosts
|
|
This documentation assumes you already have a working installation of Apache (from http://www.apache.org/httpd.html) and a working installation of Java (from http://java.sun.com/). It is also heavily linux biased - I make no apology for that! |
|
Firstly, you will need the Tomcat servlet engine for Apache. Notes on configuring Tomcat and Apache to work together can be found elsewhere on this site. |
|
Next, it will help if you have a working Cocoon site on http://127.0.0.1:8080/ -- otherwise it will be difficult to tell if virtual hosting is working correctly or not! See the Cocoon quick-start guide for more information on how to do this. |
|
You need to configure Tomcat to tell it about the virtual hosts. Edit the jakarta-tomcat/conf/server.xml file and add the following: |
<Host name="host1.yourdomain"> <Context path="" docBase="/web/host1" debug="0"/> </Host>
|
Now you need to tell Apache about the virtual host. Edit the apache/httpd.conf file and add the following: |
<VirtualHost host1.yourdomain> DocumentRoot /web/host1 ServerName host1.yourdomain JkMount /* ajp13 </VirtualHost>
|
If you do not already have an appropriate DNS entry or line in your /etc/hosts file, now would be a good time to add one. The following in /etc/hosts should work: |
127.0.0.2 host1.yourdomain host1
|
Finally, restart Tomcat and then Apache. Visit the virtual host at http://host1.yourdomain/ and you should see the site up and running. |
|
Feedback
|
|
If you notice any errors or omissions or have any comments about this quickstart guide, please get in touch. Email info@luminas.co.uk or see the Contacts page for other ways of getting in touch. |
![]() |