The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

jsp over port 80 with EasyApache and Tomcat with mod_jk does not work out of the box

Discussion in 'EasyApache' started by Jan-Paul, Jun 18, 2015.

  1. Jan-Paul

    Jan-Paul Registered

    Joined:
    Mar 24, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Maarheeze
    cPanel Access Level:
    Root Administrator
    Hello,
    I have a CentOS 6.6 VPS with WHM/Cpanel and I have followed the instructions at https://forums.cpanel.net/threads/cpanel-tomcat-jsp-and-servlets-guide.282922/ to install EasyApache (2.2.29) with Tomcat 7.

    After this I added an account and installed servlets on this account using WHM > Account Functions > Install Servlets.

    Now the testjsp.jsp is only available at http://www.domain.com:8080/testjsp.jsp and not at http://www.domain.com/testjsp.jsp

    My question is simple: What do I need to do to make the testjsp.jsp visible at http://www.domain.com/testjsp.jsp?
     
  2. Jan-Paul Kleijn

    Joined:
    Jun 18, 2015
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Maarheeze
    cPanel Access Level:
    Root Administrator
    I asked the guys from cPanel for help and the support bloke came to a conclusion that my firewall (iptables) blocked port 8009. I stopped the firewall on the command line:

    /etc/init.d/iptables save
    /etc/init.d/iptables stop
    /sbin/chkconfig --del iptables

    And after that the testjsp.jsp page was available through port 80.

    After that I installed CSF (without restarting iptables, I let CSF do that) with:

    wget http://www.configserver.com/free/csf.tgz
    tar -xzf csf.tgz
    cd csf
    sh install.sh

    Then I configured port 8009 in WHM > Plugins > CSF. Now it all works perfectly.

    So for recap, the most important is to:
    - install EasyApache + Tomcat7;
    - install servlets for your domain via WHM > Account functions > Install servlets;
    - adjust iptables (not very easy, I recommend using CSF) to make port 8009 listen for requests.

    That is the most important bit to make it all work.

    After that you can let Apache know which webfolder needs Tomcat by adjusting the files:

    /usr/local/apache/conf/userdata/std/2/$user/$domain/cp_jkmount.conf

    and

    /usr/local/apache/conf/userdata/ssl/2/$user/$domain/cp_jkmount.conf

    An example (in my case for the use of XWiki) of such a file is:

    <IfModule mod_jk.c>
    JkMount /*.jsp ajp13
    JkMount /servlet/* ajp13
    JkMount /servlets/* ajp13
    JkMount /*.do ajp13
    JkMount /xwiki/* ajp13

    </IfModule>

    I hope this can be of help to someone.
     
    #2 Jan-Paul Kleijn, Jun 22, 2015
    Last edited: Jun 22, 2015
    Ana Angel likes this.
  3. Ana Angel

    Ana Angel Registered

    Joined:
    Jul 5, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Norway
    cPanel Access Level:
    Reseller Owner
    this is really awesome. I also had the same problem. Now my issue has been solved.
    Thank you
     
Loading...

Share This Page