Pivotal/tcserver
(→Setting the environment variables) |
|||
Line 18: | Line 18: | ||
Install tcserver, ant, and java | Install tcserver, ant, and java | ||
<nowiki>~$ sudo yum install pivotal-tc-server-standard ant java-1.8.0-openjdk</nowiki> | <nowiki>~$ sudo yum install pivotal-tc-server-standard ant java-1.8.0-openjdk</nowiki> | ||
− | ==Setting the | + | ==Setting the user variables== |
− | To discover your Java home variable, you need to find the executable location and then use that to discover JAVA_HOME | + | To discover your Java home variable, you need to find the executable location and then use that to discover JAVA_HOME. You will need to omit '''<code>/jre</code>''' if it appears in your java_home results. |
<nowiki>~$ which java | <nowiki>~$ which java | ||
/bin/java | /bin/java | ||
Line 26: | Line 26: | ||
Ant HOME should always be '''<code>/usr/share/ant</code>'''<br \> | Ant HOME should always be '''<code>/usr/share/ant</code>'''<br \> | ||
<br\> | <br\> | ||
− | With both the <code>JAVA_HOME</code> and <code>ANT_HOME</code> found, we can set the following in our bash profile: | + | With both the <code>JAVA_HOME</code> and <code>ANT_HOME</code> found, we can set the following in our bash profile. Make sure to omit '''<code>/jre</code>''' from your JAVA_HOME: |
− | <nowiki>export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 | + | <nowiki>export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64" |
export ANT_HOME="/usr/share/ant" | export ANT_HOME="/usr/share/ant" | ||
export PATH=$PATH:$JAVA_HOME/bin</nowiki> | export PATH=$PATH:$JAVA_HOME/bin</nowiki> | ||
You can use the following to append the variables in your bash profile, '''make sure to update the variables to match your versions'''. | You can use the following to append the variables in your bash profile, '''make sure to update the variables to match your versions'''. | ||
− | <nowiki>~$ echo -e export JAVA_HOME='"'/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64 | + | <nowiki>~$ echo -e export JAVA_HOME='"'/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64'"'"\n"export ANT_HOME='"'/usr/share/ant'"'"\n"export PATH='$PATH:$JAVA_HOME/bin' >> ~/.bash_profile</nowiki> |
+ | '''NOTE:''' ''I would set the user variables to both your sudo capable user '''AND''' the tcserver user''. | ||
+ | ==Testing with Hello World app== | ||
+ | With tcserver installed and its dependencies configured, we can test it with a simple hello world java app.<br \> | ||
+ | <nowiki>~$ git clone https://github.com/carefreepineapple/hello-world-war.git</nowiki> |
Revision as of 11:50, 13 August 2018
tcserver
Contents |
Overview
https://content.pivotal.io/blog/part-one-comparing-apache-tomcat-and-pivotal-tc-server
Pivotal tc server builds on top of Apache Tomcat and adds a few key features:
- Enterprise support (with purchased license)
- Multi-instance support with shared binaries - individual runtime instances allows a separation between the binaries and the applications/configuration, allowing one set of binaries to power multiple instances.
- Variable substitution within server.xml - allows for consistent configuration and port management
Note: Pivotal tcserver 3.x is available through the pivotal repo, however to get the latest version, 4.x, you need to download and install the RPM from pivnet manually.
https://tcserver.docs.pivotal.io/4x/docs-tcserver/topics/whats-new-4.0.0.html#rpm-packaging
Installing tcserver 3.x - Linux
In this example we will be installing tcserver 3.x on a CentOS 7 vm using the pivotal repo.
Adding the Pivotal Repo and installing the package
Accept the EULA
~$ wget -q -O - http://packages.pivotal.io | sudo sh
Verify you see the new package
~$ sudo yum search pivotal-tc-server-standard
Install tcserver, ant, and java
~$ sudo yum install pivotal-tc-server-standard ant java-1.8.0-openjdk
Setting the user variables
To discover your Java home variable, you need to find the executable location and then use that to discover JAVA_HOME. You will need to omit /jre
if it appears in your java_home results.
~$ which java /bin/java ~$ /bin/java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home' java.home = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64/jre
Ant HOME should always be /usr/share/ant
With both the JAVA_HOME
and ANT_HOME
found, we can set the following in our bash profile. Make sure to omit /jre
from your JAVA_HOME:
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64" export ANT_HOME="/usr/share/ant" export PATH=$PATH:$JAVA_HOME/bin
You can use the following to append the variables in your bash profile, make sure to update the variables to match your versions.
~$ echo -e export JAVA_HOME='"'/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64'"'"\n"export ANT_HOME='"'/usr/share/ant'"'"\n"export PATH='$PATH:$JAVA_HOME/bin' >> ~/.bash_profile
NOTE: I would set the user variables to both your sudo capable user AND the tcserver user.
Testing with Hello World app
With tcserver installed and its dependencies configured, we can test it with a simple hello world java app.
~$ git clone https://github.com/carefreepineapple/hello-world-war.git