I am planning a migration from our current server (Sun OS 5.8) to our new server (Redhat 4 64-bit). I have recreated a similar infrastructure on the new server - Apache2, Tomcat, MySQL, Twiki.
On the current server I am running Apache 2.0.49 and Tomcat 5.0.24
On the new server I am running Apache 2.0.52 and Tomcat 5.5.25
On each machine I am using default ports: port 80 for Apache and 8080 for Tomcat.
All the pieces on the new server are working fine and accessing stuff only in the new environment.
My problem is to seamlessly redirect any links/references to the old domain/server to the new one, for both Apache2 (port 80) and for Tomcat (port 8080).
On the old server, I know I can add a redirect in apache's httpd.conf to redirect all apache
requests (for documents and cgi-bin scripts) to the new server and that seemed to work fine:
Redirect permanent / http://myweb.newdomain.com/
Tomcat is running and handling all requests sent to http://myweb.olddomain.com:8080/
What I need is to also redirect those tomcat webapp requests. And I just want the simplest, easiest way to do so. Speed or load is not an issue.
I want all of these type of references to redirect smoothly:
I've searched forums and found lots of suggestions using a variety of techniques,
but have not been successful. I'm not very familiar with mod_rewrite, mod_jk, 301 redirection, etc. but am learning slowly.
I was also experimenting with Paul Tucke's URLRewriteFilter, but couldn't get that to work
(it would not match any of my "from" expressions).
It seems to me that this shouldn't be that complicated hard, but I'm finding it very confusing and frustrating. I think I should be able to do it perhaps using mod_rewrite, but I get tangled trying to determine specifically what I need to add to accomplish that.
What would you recommend as the easiest way to get all of these redirections to occur
from an old server in one domain to a new server in another domain?
I've reverted to what was the original conf files for apache and for tomcat (without any of my additions).
When I start up tomcat, I see the following in the catalina.out file:
Nov 17, 2008 3:44:49 AM org.apache.coyote.http11.H
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 17, 2008 3:44:49 AM org.apache.jk.common.Chann
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 17, 2008 3:44:49 AM org.apache.jk.server.JkMai
INFO: Jk running ID=0 time=0/22 config=null