cachout58

Member
Aug 10, 2016
22
2
3
Dl
cPanel Access Level
Root Administrator
Hi,

We could create a small module which allows Tomcat work with easyapache 4. It works in production servers too. However there are couple of issues that we face

1. We believe cpanel uses jsvc for tomcat. May we know how it is done or benifits of it. [ Very rarely we have tomcat restarting frequently when faulty classes or jar files are uploaded ]
2. We followed the same method as easyapache 3 where a conf file for enabling jsp support for a domain and jk.conf file where worker properties are configured. When we rebuild httpdconf we get the following error

The “/usr/sbin/httpd” command (process 12001) reported error number 1 when it ended.
Configuration problem detected on line 1 of file /etc/apache2/conf.modules.d/jk.conf: JkWorkersFile only allowed once

Any suggestions
 

Anoop P Alias

Well-Known Member
Mar 31, 2015
103
15
18
Kochi,Kerala,India
cPanel Access Level
Root Administrator

cachout58

Member
Aug 10, 2016
22
2
3
Dl
cPanel Access Level
Root Administrator
Thank you guys for your replies.

I believe those plugins work only in easy apache 3 and not in 4.

We are working for a module with easy apache 4.

Any idea on how to avoid the error mentioned and how to make use of jsvc
 

Anoop P Alias

Well-Known Member
Mar 31, 2015
103
15
18
Kochi,Kerala,India
cPanel Access Level
Root Administrator
The plugin works with EA4 too as it simply proxies to tomcat on the http port . cPanel use ajp and its a binary protocol and needs additional module support from apache httpd end .It probably might be more advanced than http . But you can easily implement a reverse proxy to tomcat (over http protocol) with mod_proxy which is standard in httpd. The plugin I mention is a nginx plugin and it simply reverse proxies to tomcat just like it does to apache httpd
 

cachout58

Member
Aug 10, 2016
22
2
3
Dl
cPanel Access Level
Root Administrator
The part that deals with apxs and ajp is over. We have crossed that bridge. We have some 10 % work left out which involves jsvc and fixing that error during a rare case of httpdconf rebuild. The reverse proxy method which you suggested has some limitations when deployed in a high availability environment. Thats why the cpanel method of apxs and ajp is best suited for cpanel servers. Any help from cpanel developers ?
 

cachout58

Member
Aug 10, 2016
22
2
3
Dl
cPanel Access Level
Root Administrator
We have already voted there. We were asked to raise this issue in the forum for any help in jsvc. Thats why we created this thread. Any help in jsvc implementation ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello,

I'm not aware of any additional workarounds that would address the issue with EasyApache 4. You may want to consult with a system administrator to see if custom work could be completed to get it working. You can find a list of system admin services on the following URL:

System Administration Services | cPanel Forums

Thank you.
 

MarcoP

Member
Nov 17, 2006
7
1
153
cPanel Access Level
Root Administrator
Last month I was able for the first time to upgrade from EasyApache 3 to EasyApache 4 and still keeping, in that case, Confluence working.

- If you use MPM ITK, build a new profile using a different MPM and if you need to, at the very end, return to your preferred profile.

- Upgrade EasyApache.

- Handpick your Tomcat proxies from /usr/local/apache.ea3/conf/userdata/... and copy them to /etc/apaches/conf.d/userdata/...

- Copy and rename jk.conf
Code:
cp /usr/local/apache.ea3/conf/jk.conf /etc/apache2/conf.modules.d/991_mod_jk.conf
- Load the module
Code:
ex -sc '1i|LoadModule jk_module modules/mod_jk.so' -cx /etc/apache2/conf.modules.d/991_mod_jk.conf
- Create mod_jk.so softlink
Code:
ln -s -t /etc/apache2/modules /usr/local/apache.ea3/modules/mod_jk.so
- Check and if all good reload Apache config
Code:
apachectl -t
service httpd graceful
Done! All should be working now.

Return to MPM ITK if you need to.

Hope it helps, cheers.
 
Last edited:
  • Like
Reactions: cPanelMichael

MarcoP

Member
Nov 17, 2006
7
1
153
cPanel Access Level
Root Administrator
Do you have any suggestions for new installs with EA4 since EA3 isn't provided/supported in new releases?
I don't have a box where to test in advance, but i guess installing easy-tomcat7 is a start.

I'm not even sure how long easy-tomcat7 will stll be available and or if updates will be pushed into repos... my main concern would be either choose the EasyApache way or yours, after all you need Apache+Connector+Tomcat.
 
Last edited:

MarcoP

Member
Nov 17, 2006
7
1
153
cPanel Access Level
Root Administrator
Hello,

I'd like to follow-up my tweaks and let you know everything is still up and running smoothly even after last updates.

One think I've modified from the above guide is moving, instead of soft-linking, mod_jk.so.

Cheers.
 

cachout58

Member
Aug 10, 2016
22
2
3
Dl
cPanel Access Level
Root Administrator
Hi Marco,

Have you tried your steps in fresh easyapache 4 servers yet ?

Because the jsvc issue which we are facing is in easyapache 4 servers [ basically a new server with easy apache 4 direct ]

We could re-create 95% of the features as in cpanel. Only big issue is jsvc, other than small issues.
 

MarcoP

Member
Nov 17, 2006
7
1
153
cPanel Access Level
Root Administrator
Hi Marco,

Have you tried your steps in fresh easyapache 4 servers yet ?

Because the jsvc issue which we are facing is in easyapache 4 servers [ basically a new server with easy apache 4 direct ]

We could re-create 95% of the features as in cpanel. Only big issue is jsvc, other than small issues.
This weekend I'll come back from my long deserved holiday trip, get a cPanel trial licence and test on a CentOS 7 vm as I will need my self to move on from CentOS 6.

I will keep you updated as I'll be facing the same issue.