Skip to main content

Tomcat and JSP support

Comments

10 comments

  • cPanelMichael
    Hello @Jon Erickson, The /scripts/addservlets script is no longer utilized with Tomcat version 8.5 in EasyApache 4. The following documents include information about how to use Tomcat and setup applications with EasyApache 4: Tomcat - EasyApache 4 - cPanel Documentation Tomcat Private Instances - EasyApache 4 - cPanel Documentation Tomcat Proxies - EasyApache 4 - cPanel Documentation Let me know if this helps, or if you have additional questions. Thanks!
    0
  • Jon Erickson
    @cPanelMichael I've read through these doc throughly. So confirming, there is no additional install servel step with EA4? Second, any reason why I would get a ubic command not found error?
    0
  • cPanelMichael
    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:
    0
  • GDPR Anonymized user
    Hello All ! I have enabled the tomcat for the domain and followed the url given by cPanel [ Tomcat - EasyApache 4 - cPanel Documentation ], 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: #====================================#==================================== #====================================#==================================== 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 #====================================#==================================== ProxyPass "/" "ajp://127.0.0.1:10003/" #====================================#==================================== 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 . 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 ] #====================================#==================================== #====================================#==================================== 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.
    0
  • cPanelMichael
    Hello :) We recently published the following Tomcat guide that you may also find helpful:
    0
  • mikerich6
    Hello All ! I have enabled the tomcat for the domain and followed the url given by cPanel [ Tomcat - EasyApache 4 - cPanel Documentation ], 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: #====================================#==================================== #====================================#==================================== 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 #====================================#==================================== ProxyPass "/" "ajp://127.0.0.1:10003/" #====================================#==================================== 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 . 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 ] #====================================#==================================== #====================================#==================================== 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.

    Hello backupmx, this is great thanks, I did all this and it works perfectly well, however I'm struggling with SSL configuration, would you be able to assist on that matter please? Thank you!
    0
  • SamuelM
    Hello @mikerich6, Did you make certain to enable SSL in the Tomcat configuration? You can find instructions on the following page for enabling SSL in Tomcat:
    0
  • mikerich6
    Thank you cPSamuel. But correct me if I'm wrong, isn't this Tomcat configuration like a manual SSL thing? I was expecting a similar behavior that EasyApache 3 had with Tomcat 7 in terms of the SSL certificates, something automatic where the SSL certs autorenew every 3 months (or whatever the timeframe is) and are applied to the whole thing. I'm not very knowledgeable in SSL nor Apache but EA3 (Apache to Tomcat) was pretty good with that. Does EA4 have that? I'll submit a ticket if that is better. Thank you!
    Hello @mikerich6, Did you make certain to enable SSL in the Tomcat configuration? You can find instructions on the following page for enabling SSL in Tomcat:
    0
  • SamuelM
    Hello @mikerich6, Configuring SSL support for Tomcat must be done manually. cPanel/WHM still includes the AutoSSL tool which allows you to automatically install new SSL certificates periodically. AutoSSL is independent of EasyApache and Tomcat. I do encourage you to go ahead and submit a ticket for further assistance with SSL support for Tomcat, as this is diverging from the original topic of this thread. We will be happy to help with any remaining issues you might have via ticket!
    0
  • GDPR Anonymized user
    Hello backupmx, this is great thanks, I did all this and it works perfectly well, however I'm struggling with SSL configuration, would you be able to assist on that matter please? Thank you!

    Please enjoy! Here are the steps. [I recommend having the premium SSL of 1 Year or 3 Year instead of Free so that you will not have to do same thing in each 3 month ] >> WHM/TomcatSSL Note: Mydomain : [ example.tk ] & Myusename: [ example ] check your and replace in your case I hope you have confiured the tomcat on website [ example.tk ] and now need to enable SSL. 1) Run below commands to created file and folders. #====================================#==================================== mkdir -p /etc/apache2/conf.d/userdata/ssl/2_4/example/example.tk touch /etc/apache2/conf.d/userdata/ssl/2_4/example/example.tk/example.conf nano /etc/apache2/conf.d/userdata/ssl/2_4/example/example.tk/example.conf #====================================#==================================== 2) Use the command [ cat /home/example/ea-tomcat85/conf/server.xml | grep AJP ] to grep the server.xml file. Find the Ajp/1.3 [Connector port="10003">, It should look something like this: [ ] Write/Append the below code: [Your port number is 10003.] #====================================#==================================== ProxyPass "/" "ajp://127.0.0.1:10003/" #====================================#==================================== Finally, save it. 3) Now you need to rebuild the HTTPD, so use the below command, And also restart the HTTPD by using the below commands. #====================================#==================================== /usr/local/cpanel/scripts/rebuildhttpdconf /usr/local/cpanel/scripts/restartsrv_httpd #====================================#==================================== 4) Prepair the SSL Certification and Key file in p12 file, now upload the crt and key over server any localtion in my case [/home/example/ea-tomcat85/tomcat_ssl/] and run below command to get .p12 keystore file and use password as 123456789 #====================================#==================================== openssl pkcs12 -export -in example.crt -inkey example.key -out mycert.p12 -name tomcat #====================================#==================================== Informative: example.crt [ mycrtificat of website example.tk ] Informative: example.key [ mykeyfile of website example.tk ] 5) Go to [ /home/example/ea-tomcat85/conf/ ] directory, There you should find a server.xml file. 6) Use the command [ cat /home/example/ea-tomcat85/conf/server.xml | grep ", It should look something like this which is need to commed manually Find and comment or remove the line as below and remember connector port="10016" #====================================#==================================== #====================================#==================================== And append below parameters #====================================#==================================== #====================================#==================================== Informative: keystorePass="Yourpassword" Informative: keystoreFile="/home/example/ea-tomcat85/tomcat_ssl/mycert.p12 [location of .p12 file ] Informative: redirectPort="10052" [SSL redirection port always use new like 10053 or 10054 if any tomcat running on it already] 7) Finally restart the tomcat server using command [/scripts/ea-tomcat85 all restart ] #====================================#==================================== /scripts/ea-tomcat85 all restart #====================================#==================================== check the website over browser
    0

Please sign in to leave a comment.