How to install Tomcat from EasyApache

How to install Tomcat from EasyApache

The Apache Tomcat is actually a server and a servlet container, it enables a webserver to handle aggressive Java-based web content using the HTTP protocol. 

The apache is a traditional web server, optimized for handling static and dynamic web content (very often PHP-based), its absence the ability to manage Java Servlets and JSP. The Tomcat is almost totally geared towards Java-based content. Tomcat was originally developed as a means to provide the JSP functionality that Apache absence. 

In order to install Tomcat from EasyApache, first, we need to Enable Tomcat 8.5 support for a cPanel account. 

WGIB7Y8QIRAqXOoKOAtGmYaPMeFbv1EEt2kxs7rRG7617TTv Kd L3 ScsjsNm5s0oZSx4n sbYVRa3X68Z0UCpTMhz25uUq2sRFj2iBSf8NR5GCa4g 1it38m97cs2XfhWUird5

After enabling Tomcat from the cPanel Tomcat Manager panel, create an A folder to host tomcat code “ea-tomcat85” will be created under the cPanel account home directory.

Once we created the folder “ea-tomcat85” under the cPanel account home directory, then Configure the application by adding the below line to 

/home/cpuser/ea-tomcat85/conf/server.xml under section <Host>. 

<Context path=”/” docBase=”/home/cpuser/ea-tomcat85/webapps/ROOT/”> </Context> 

We can test the configuration by following the below-provided steps. 

su – cpuser 

echo “export PATH=$(dirname $(readlink /usr/local/cpanel/3rdparty/bin/perl)):$PATH” >> /home/cpuser/.bashrc 

source ~/.bashrc 

Edit /home/cpuser/ea-tomcat85/conf/server.xml, look for deployOnStartup under <Host> section. Then, change to following value 

deployOnStartup=”true”

cp /opt/cpanel/ea-tomcat85/test.jsp /home/cpuser/ea-tomcat85/webapps/ROOT/ 

Then Restart Tomcat service, 

ubic stop ea-tomcat85 

ubic start ea-tomcat85 

ubic status ea-tomcat85 

TD mrfhFg3NGq IvdJjDVYzkMcP1RKiJ56l8sKwzHVR jhygkkNsdsfCpxJFmXpAWO8dpdYQo0vHwcfmjicpkiC0zGODK Cg YSvZzAQRW9C56PWYDmm8LE gR0eIvTfLHN6 a9J

To check the HTTP connector’s port: 

egrep ‘Connector port.*HTTP’ /home/cpuser/ea-tomcat85/conf/server.xml

Q78RN4UhlCNY hl SEjFiyp3t6Xzf WNnRR2rG2q7H3l ho3a8CXRsxSyLaj4ucPaSa2m363B clN8yXm7HYvPPBZplbmjHVyNCMg KQKa169AakyMiXPo4PNXzTDZDGwYB3mlbH

Once you have verified the connection port, then you can browse from URL http://yourwebsitename:10002/test.jsp

YPFdVPYK3SCIZGotQL5QbubYUf3B4U54yv 2a2i2bvvoHsUjxhDoYWZs2lX3HO7MMhR drQGmd2Xaapoxea 1DnFJm nsa S66NBexL2kmZvn8KcZMZL5EJhZfAz 9Q7NbUFiH2

We can configure the SSL for the site by following the below-provided steps. 

Create a new port for SSL site. 

/scripts/cpuser_port_authority list cpusername 

nK9M VHDHsOEUIf5M 7YNlqr2u1MhtwNEgzGtziVtPlPFqLAF7v8EK1NEQpKCyFsm7souxJkYjP4KHcHDoprFiu34lFew y62MQSP

/scripts/cpuser_port_authority give tomcatmar 1 –service=ea-tomcat85

Fi eEPl56Oj r77FI8TQ2HaKuBYmE2Kq gm6qwV9T2s9uzDx2JOqOaYolvCOChZ 4x0jqzm99WMEnw70T9mPRf qdC1j aUplnqwjGaAVOpdCGamI1GNw2IYv9Zh2B7 qednW9 z

This command creates a new port 10004 which will be used for the tomcat SSL port. Export PEM key to Java Keystore ( Java SSL name ) by using cPanel generated SSL key. 

openssl pkcs12 -export -in combined_crt_ca_key -inkey private.key -out keystore -name domain.com -passin pass:password -passout pass:password 

Opened /home/cpuser/ea-tomcat85/conf/server.xml, right below the line which begins with “<Connector port=”10001″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ xpoweredBy=”false”/>”, adding below line 

<Connector port=”10004” protocol=”org.apache.coyote.http11.Http11Protocol” SSLEnabled=”true” scheme=”https” secure=”true” sslProtocol=”TLS” 

keystoreFile=”/home/cpuser/ea-tomcat85/conf/ssl/kestorefile” keystorePass=”password”/> 

Restart Tomcat service. 

W99jOnSD1T9V5HXL15a1KBZIbCgj6vm6PfUuAq K3SHHOm y ReoPvg7hwIl1Svgf2ANUu0yt5Rj06zRCgciyD nlz 8lIzy7kUhUhnfjKsCh0ucsVb2 gmPU871oPRWBoD9QF2H

Once you restart the Tomcat service, you can browse with HTTPS URL.

TZ9cSXz9EkMhvHCrAsaAmwzgJKcHE84gx7XLDIvF26xMF2jNZyHQvUsasFM27lnNgck3yI9oh

We can proxy the Tomcat to Apache by following the below-provided steps.

Uncomment the below line from the apache configuration file. 

In order to customize this VirtualHost, we can use an include file at the following location Include “/etc/apache2/conf.d/userdata/std/2_4/cpuser/domain.com/*.conf” 

Then create a file name tomcatproxypass.conf or any file name, insert below the line. 

<IfModule proxy_ajp_module> 

ProxyPass “/” “ajp://127.0.0.1:10003/” 

</IfModule> 

Now can browse the URL like below, 

Tomcat port 

http://tomcat.example.com:10002/test.jsp 

https://tomcat.example.com:10004/test.jsp

 

Apache proxy port 

http://tomcat.example.com/test.jsp 

https://tomcat.example.com/test.jsp

GET STARTED WITH US

 

Leave a Reply