cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx 8 install on the Linux

Level 7

ThingWorx 8 install on the Linux

Hi all,

I follow the document to intall ThingWorx 8 on the RedHat

But I can't success to startup tomcat service.

When I start tomcat service. It will say 'ExecStart=/usr/share/tomcat8.5/bin/jsvc ....' error

 

Does anyone has install success on RedHat? Please help me. 

 

Thanks.

 

[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
PIDFile=/var/run/tomcat.pid
Environment=CATALINA_PID=/var/run/tomcat.pid
Environment=JAVA_HOME=/usr/lib/jvm/jdk1.8.0_92
Environment=CATALINA_HOME=/usr/share/tomcat8.5/8.5.13
Environment=CATALINA_BASE=/usr/share/tomcat8.5/8.5.13
Environment=CATALINA_OPTS=
ExecStart=/usr/share/tomcat8.5/8.5.13/bin/jsvc \
 -Dcatalina.home=${CATALINA_HOME} \
-Dcatalina.base=${CATALINA_BASE} \
-Djava.awt.headless=true -
Djava.net.preferIPv4Stack=true -Dserver -Dd64 -XX:+UseNUMA \
 -XX:+UseConcMarkSweepGC -Dfile.encoding=UTF-8 \
 -
Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions \
 -cp ${CATALINA_HOME}/bin/commonsdaemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcatjuli.jar
\
 -user tomcat8.5 \
 -java-home ${JAVA_HOME} \
 -pidfile /var/run/tomcat.pid \
 -errfile ${CATALINA_HOME}/logs/catalina.out \
-outfile ${CATALINA_HOME}/logs/catalina.out \
$CATALINA_OPTS \
org.apache.catalina.startup.Bootstrap
[Install]
WantedBy=multi-user.target

 

4 REPLIES 4

Re: ThingWorx 8 install on the Linux

This isn't an official answer - i'm just trying to help out... here's one I use (paths are redacted, 'current' is a symlink to the version of apache/java to make upgrading/changing/rolling back easier:

 

cat /etc/systemd/system/thingworx.service

[Unit]
Description=Tomcat 8 - ThingWorx
After=syslog.target network.target

[Service]
Type=simple
User=thingworx
Group=thingworx
ExecStart=/path/to/tomcat/current/bin/catalina.sh run
# ExecStop=/path/to/tomcat/current/bin/shutdown.sh
Restart=on-abort
TimeoutSec=300
SyslogIdentifier=tomcat-%i
EnvironmentFile=/path/to/tomcat/tomcat.conf

[Install]
WantedBy=multi-user.target

tomcat.conf

JAVA_OPTS=
CATALINA_HOME="/path/to/tomcat/current"
JAVA_HOME="/path/to/java/current"
CATALINA_TMPDIR="/path/to/tomcat/current/temp/"
CATALINA_OPTS=
THINGWORX_PLATFORM_SETTINGS="/path/to/thingworx/ThingworxPlatform/platform-settings.json"

Re: ThingWorx 8 install on the Linux

Hi cdovholuk:

 

Thanks for your reply.

It could use on production environment?

I remember ThingWorx 8 (above), it need a parameter 'Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions'

But I didn't see that where is in script?

Re: ThingWorx 8 install on the Linux

you can create one setenv.sh file in $CATALINA_HOME/bin directory and define this path there like-

CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions"

 

This is one of the way to do it .You can also mark this library path in path variable of LD_LIBRARY_PATH as well .

Highlighted

Re: ThingWorx 8 install on the Linux

I finished to install ThingWorx  on the Linux

I had two mistakes on the script.

 

commonsdaemon.jar -> commons-daemon.jar

tomcatjuli.jar -> tomcat-juli.jar

 

This is right script.

[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
PIDFile=/var/run/tomcat.pid
Environment=CATALINA_PID=/var/run/tomcat.pid
Environment=JAVA_HOME=/usr/lib/jvm/jdk1.8.0_92
Environment=CATALINA_HOME=/usr/share/tomcat8.5/8.5.13
Environment=CATALINA_BASE=/usr/share/tomcat8.5/8.5.13
Environment=CATALINA_OPTS=
ExecStart=/usr/share/tomcat8.5/8.5.13/bin/jsvc \
 -Dcatalina.home=${CATALINA_HOME} \
-Dcatalina.base=${CATALINA_BASE} \
-Djava.awt.headless=true -
Djava.net.preferIPv4Stack=true -Dserver -Dd64 -XX:+UseNUMA \
 -XX:+UseConcMarkSweepGC -Dfile.encoding=UTF-8 \
 -
Djava.library.path=${CATALINA_BASE}/webapps/Thingworx/WEB-INF/extensions \
 -cp ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
\
 -user tomcat8.5 \
 -java-home ${JAVA_HOME} \
 -pidfile /var/run/tomcat.pid \
 -errfile ${CATALINA_HOME}/logs/catalina.out \
-outfile ${CATALINA_HOME}/logs/catalina.out \
$CATALINA_OPTS \
org.apache.catalina.startup.Bootstrap
[Install]
WantedBy=multi-user.target