Jon Erickson

Registered
Apr 16, 2019
4
0
1
USA
cPanel Access Level
Root Administrator
I have installed Tomcat using EasyApache 4, enabled tomcat on the subdomain and it appears the next step is to install the servlets. When I attempt to run the following command, I receive a directory not found error and the script does not appear to be in the scripts directory.

Command:
/scripts/addservlets --domain=subdomain.example.com

Any help installing Tomcat on Centos 6 VPS would be greatly appreciated.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
So confirming, there is no additional install servel step with EA4?
That's correct. Once you've installed Tomcat, simply enable Tomcat for the user with the instructions at:

Add Tomcat support for a user

Second, any reason why I would get a ubic command not found error?
We can attempt to reproduce the issue on a test server. Can you let us know the full step-by-step instructions of how you are reproducing the error?

Thank you.
 

backupmx

Member
Jul 25, 2018
5
1
3
India
cPanel Access Level
Root Administrator
Hello All !

I have enabled the tomcat for the domain and followed the url given by cPanel [ https://documentation.cpanel.net/display/EA4/Tomcat[URL="https://documentation.cpanel.net/display/EA4/Tomcat"]Tomcat - EasyApache 4 - cPanel Documentation [/URL]], i was getting lot of issue but finally i have found the way to get my tomcat application deployed and it it was working well. [Now testing domain remove from server]

Here what i have used to get address my issue, mean everything that you need to do if you want to deploy the tomcat application in easy way, all you need to put your jsp or extracted war under your public_html folder and application will start working.


Enable the Tomcat from cPanel server or from command line then follow the steeps below.

My_Domain : "example.tk" & MY_Username: "example" check your and replace in your case

1) Build your web app [ demo_app.war ] file for example purposes. Rename it to [ demo_app.zip ] and upload over the server by login to cPanel.
2) Upload in your server go to the /home/user-name/ea-tomcat85/webapps/ROOT/ or under your public_html folder location and unzip the file [ demo_app.zip ]
4) Go to /home/demotomcat/ea-tomcat85/conf/ directory, There you should find a server.xml file.
5) Use the command cat/vi/nano server.xml to view the server.xml file. Find the Ajp/1.3 connector port. It should look something like this:

#====================================#====================================
<Connector port="10003" protocol="AJP/1.3" redirectPort="10002"/>
#====================================#====================================

Remember the port number is 10003.

6) Now go to this location: /etc/apache2/conf.d/userdata/std/2_4/user-name/your-domain-name/ [if you are not able to see the folder file then crate it by using below command]


#====================================#====================================
mkdir -p /etc/apache2/conf.d/userdata/std/2_4/demotomcat/demotomcat.tk/
touch /etc/apache2/conf.d/userdata/std/2_4/demotomcat/demotomcat.tk/demotomcat.conf
vi /etc/apache2/conf.d/userdata/std/2_4/demotomcat/demotomcat.tk/demotomcat.conf
#====================================#====================================

Append the below code under file demotomcat.conf

#====================================#====================================
<IfModule proxy_ajp_module>
ProxyPass "/" "ajp://127.0.0.1:10003/"
</IfModule>
#====================================#====================================
Now save it.

8) Now you need to rebuild the HTTPD, so use the below command
#====================================#====================================
/usr/local/cpanel/scripts/rebuildhttpdconf
#====================================#====================================


And now restart the HTTPD by using the below command:

#====================================#====================================
/usr/local/cpanel/scripts/restartsrv_httpd
#====================================#====================================

9) Go to /home/demotomcat/ea-tomcat85/conf/ directory again and append below line in yuor server.xmpl and please append this under the parameter <Host></Host>.

Informative: this is the path where you can modify the same as per your convenience for uploading the jsp application, if you want to upload application under public_html then change it from [ /home/demotomcat/ea-tomcat85/webapps/ROOT/ ] to [ /home/demotomcat/public_html ]

#====================================#====================================
<Context path="/" docBase="/home/demotomcat/ea-tomcat85/webapps/ROOT/"></Context>
#====================================#====================================

10) Finally restart the tomcat server using command [/scripts/ea-tomcat85 all restart ]

#====================================#====================================
/scripts/ea-tomcat85 all restart
#====================================#====================================

Request: I request cPanel Development team to build some script [like manual entry mentioned above] in new cPanel that run after enable the tomcat for domain, so that we don't have to do such task.


Note: If you need SSL configuration for your domain, then i have also tested the same and created my manual steps.
 
Last edited by a moderator:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

We recently published the following Tomcat guide that you may also find helpful:


Thank you.