1

In my server, I installed the apache and tomcat. But, when I access the my site, www.mysite.com, will for the apache. I want that access the tomcat, because I will put my site in tomcat. How to ?

gustavosiq
  • 31
  • 1
  • 3
  • 7

2 Answers2

2

Set up a connector from Apache to Tomcat (one such connector is mod_jk). Here are some docs on how to do it:

http://tomcat.apache.org/connectors-doc/generic_howto/quick.html

http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

There's also this ServerFault question from a while ago:

How do I properly run Tomcat alongside Apache?

(Actually, look at the Related topics columns on the right of this page; you'll see a bunch of things related to Apache and Tomcat)

Basically, Apache is in front of Tomcat, and will act as a reverse proxy. Apache can be used to handle the static content of your site, and Tomcat the dynamic part.

cjc
  • 24,916
  • 3
  • 51
  • 70
2

You can do it enabling the ProxyPass directive in apache config file.

ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
Mughil
  • 1,929
  • 1
  • 19
  • 28