Apache + Tomcat Problem

Discussion in 'Java' started by Bryan, Jun 21, 2007.

  1. Bryan

    Bryan Guest

    Hello all,

    I'm having a problem with my connection between Apache and Tomcat
    using mod_jk. I have it working right now with my VirtualHost in
    Apache... any time I get a request for /java-stuff at xy.some-
    domain.com I use JkMount to forward the request to Tomcat using
    ajp13_worker, which is defined in the workers.properties class with
    the host as localhost. I also have a VirtualHost set up in Tomcat's
    server.xml file, which works just fine when I go to xy.some-domain.com:
    8080. However, if I change my host in the workers.properties file to
    use xy.some-domain.com rather than localhost, it doesn't work. I know
    the /java-stuff path is correct, because it works when I go to port
    8080.

    Any suggestions? Anyone else have this problem?

    Thanks in advance!
    Bryan, Jun 21, 2007
    #1
    1. Advertising

  2. Bryan

    Guest

    On Jun 21, 2:41 pm, Bryan <> wrote:
    > Hello all,
    >
    > I'm having a problem with my connection between Apache and Tomcat
    > using mod_jk. I have it working right now with my VirtualHost in
    > Apache... any time I get a request for /java-stuff at xy.some-
    > domain.com I use JkMount to forward the request to Tomcat using
    > ajp13_worker, which is defined in the workers.properties class with
    > the host as localhost. I also have a VirtualHost set up in Tomcat's
    > server.xml file, which works just fine when I go to xy.some-domain.com:
    > 8080. However, if I change my host in the workers.properties file to
    > use xy.some-domain.com rather than localhost, it doesn't work. I know
    > the /java-stuff path is correct, because it works when I go to port
    > 8080.
    >
    > Any suggestions? Anyone else have this problem?
    >
    > Thanks in advance!


    I remember having problems with this too, I ended up not using mod_jk,
    and using a virtual host instead... It looks something like this.

    <virtualhost *:80>
    ServerName www.dimensionalsoundproducts.com
    DocumentRoot C:/public_html
    ProxyRequests off
    ProxyPass / http://192.168.2.101:8080/dimensional/
    ProxyPassReverse / http://192.168.2.101:8080/dimensional/
    </virtualhost>

    Server Name: Is the connection to Apache you want to pass off to
    Tomcat.
    Document Root: Is your HTML root folder for Apache.
    PoxyRequests: Make sure this is off.
    ProxyPass: is where you want to pass the connection too in this case I
    have
    Tomcat set up on another computer on my network, you could also do
    this
    '/ localhost:8080/root/'
    ProxyPassReverse: Should be the exact same as ProxyPass.

    Ben.
    , Jun 21, 2007
    #2
    1. Advertising

  3. Bryan

    Bryan Guest

    Thanks for the suggestion. Is the Proxy stuff part of a separate
    module?
    Bryan, Jun 21, 2007
    #3
  4. Bryan

    Guest

    On Jun 21, 4:26 pm, Bryan <> wrote:
    > Thanks for the suggestion. Is the Proxy stuff part of a separate
    > module?


    I don't think so, if I recall you just have to uncomment mod_proxy in
    the config file.
    , Jun 21, 2007
    #4
  5. Bryan

    Bryan Guest

    Cool, thanks. I was hoping to serve the normal html/JavaScript stuff
    from Apache and let Tomcat do the Java stuff, but for now I'll have to
    do it this way.

    Thanks again.
    Bryan, Jun 21, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos Gravvanis
    Replies:
    0
    Views:
    2,034
    Christos Gravvanis
    Jul 7, 2004
  2. twins
    Replies:
    1
    Views:
    5,835
  3. Marcin Cenkier
    Replies:
    1
    Views:
    5,391
    Marcin Cenkier
    Apr 12, 2006
  4. Andi
    Replies:
    5
    Views:
    1,320
  5. tanmoy.b81
    Replies:
    0
    Views:
    875
    tanmoy.b81
    Feb 4, 2009
Loading...

Share This Page