What is the easiest way to install tomcat6 under apache2 in a Debian system?
The idea is to have all incoming connections on port 80 of a specific host to be redirected to a specific Application under tomcat webapps directory.
So for example: http://app1.myhost.com:80 goes to http://myhost.com:8080/app1/ http://app2.myhost.com:80 goes to http://myhost.com:8080/app2/
and so on
[update]
What if the machine I'm trying to configure does not have a valid IP? Actually, to access the machines port 80, I need to connect to port 54080 on another host, which redirects to the machine's port 80
This question is very vague, but I'll take a stab at it.(Edit: question was clarified a bit more)It sounds like you want to know how to configure tomcat6 to run a Java application behind an Apache2 reverse proxy. This is a pretty standard configuration.
In Debian, I believe this will involve setting up the proper modules by ensuring that /etc/apache2/mods-available/mod_proxy.so is symlinked into the /etc/apache2/mods-enabled directory.
Then you have to configure a VirtualHost that will listen on the proper IP address and proxy the requests to Tomcat. If the IP address is going to be shared hosting, you will have to use Name-Based VirtualHost (
NameVirtualHost
directive).The mod_proxy configuration is pretty straightforward, looking something like:
Obviously this is a very simple configuration and can be expanded on easily (logging, more hostnames, using ajp instead of http, etc.)
This file should be saved in /etc/apache2/sites-available/my-site-name.conf and symlinked to /etc/apache2/sites-enabled/.