Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
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
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"
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?
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 .
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