How do I redirect from Apache to Tomcat?

后端 未结 5 574
有刺的猬
有刺的猬 2020-12-07 12:31

I\'m working on my first Java site. I\'m running Apache Tomcat on port 8080, and Apache HTTPD on port 80. The current URL that I can access the site at is (for example) 123.

5条回答
  •  醉梦人生
    2020-12-07 12:44

    The usual way this is done, as you already mentioned, is to use mod_jk from Apache HTTPD to forward that content that you want to be processed by Tomcat.

    There is a Quick HowTo at tomcat.apache.org. You need to do the following:

    • Copy mod_jk.so into the appropriate modules directory for Apache HTTPD.
    • Create a configuration file workers.properties
    • In Apache HTTPD's httpd.conf, add a section to configure mod_jk.
    • Ensure that Tomcat is configured to accept the mod_jk protocol, which is usually on port 8009.

    The lines in httpd.conf with JkMount:

    JkMount  /examples/* worker1
    

    tell Apache HTTPD which requests are to be forwarded to Tomcat.

提交回复
热议问题