I am focusing on my first Java site. I am running Apache Tomcat on port 8080, and Apache HTTPD on port 80. The present URL will be able to access the website at is (for instance) 22.214.171.124:8080. I wish to remove the main harbour number in the URL before I point the domain in the new IP.
Right now I'm only using Apache for phpmyadmin, however intend on utilizing it for CGI scripts along with other stuff after i determine
mod_jk etc... So I'd rather not change Tomcat's port to 80 and switch off Apache.
I really hope this will make sense.
The right way to complete things would be to leave Apache at 80 and Tomcat at 8080 and employ a connect (ideally mod_proxy) to proxy Tomcat from Apache. mod_proxy would just take you ten minutes to setup.
This how-to really is easy to follow along with.
The typical way this is accomplished, while you already pointed out, is by using
mod_jk from Apache HTTPD to forward that content you want to become processed by Tomcat.
There's a Quick HowTo at tomcat.apache.org. You must do the next:
mod_jk.soin to the appropriate modules directory for Apache HTTPD.
- Produce a configuration file
- In Apache HTTPD's
httpd.conf, give a section to configure
- Make sure that Tomcat is set up to simply accept the
mod_jkprotocol, that is usually on port 8009.
The lines in
JkMount /good examples/* worker1
tell Apache HTTPD which demands should be submitted to Tomcat.
Both useful solutions above are great, however i much prefer mod_proxy over mod_jk. There is no extra installation to complete for mod_proxy, unlike mod_jk, and also the setup is a lot simpler. mod_jk provides you with with additional control over detailed tuning of Tomcat parameters, but when you simply desire a simple redirect from Apache to Tomcat, mod_proxy is what you want.