Skip to content

Instantly share code, notes, and snippets.

Created September 24, 2014 04:04
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Thingworx install on Ubuntu 14.04.1 VM
VirtualBox VM Install
- VirtualBox installed
- Ubuntu ISO image downloaded: ubuntu-14.04.1-server-amd64.iso
-- for 64bit architecture AMD/Intel processors
- Thingworx packages downloaded
Create new VM in VirtualBox, select ISO and use these (or other) settings:
Host thing, User Thing
Credentials: thing/thing
No LVM 64 GB
Standard installation, answer Yes to questions
Select packets to install: openssh-server (nothing else)
Reconfigure the network in VirtualBox settings:
- In VirtualBox main Preferences/Network, add a ‘named’ Host-Only network if not yet existing
- In the new VM Settings/Network, set Adapter 1 as Host-Only and select the newly created ‘named’ Host-only network.
Network Variants:
1: When connected to a wireless network, set Adapter 2 to bridge mode
2: When not connected to wireless, set Adapter 2 to NAT mode (to avoid timeouts)
Reboot VMs after a network change
sudo vim /etc/network/interfaces
# Change to following (suggestion):
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
auto eth1
iface eth1 inet dhcp
Execute in VirtualBox window for the VM (on Ubuntu):
# To find out the status and IP addresses of the eth0 and eth1 adapters
ip addr
# On Apple terminal (change IP address based on ip addr output)
ssh -l thing
# The following is optional if you want shared folders with the host:
# Mount VBoxLinuxAdditions.iso via VirtualBox menu
sudo apt-get update
sudo apt-get install dkms gcc
sudo mount /dev/sr0 /media/cdrom
cd /media/cdrom
sudo ./
sudo apt-get update
# Define Shared Folder in VirtualBox VM settings (named xxxxx)
sudo mkdir /mnt/xxxxx
Amazon EC2 Install
Amazon zone US-West 2 (Oregon)
Choose Ubuntu 12.04 LTS Precise HVM EBS-SSD boot ami-ef5e24df
# Create/Associate Security Group
Open ports SSH, HTTP, HTTPS, 8080, SOCKS5
# Associate elastic IP
ssh -i .ssh/key.pem ubuntu@xx.xx.xx.xx
# The following EBS volume setup is not necessary initially:
# Associate new EBS volumes /dev/sdg, /dev/sdh
# Format new EBS volumes
sudo mkfs -t ext4 /dev/xvdg
sudo mkfs -t ext4 /dev/xvdh
sudo vim /etc/fstab
# Add lines
#/dev/xvdm /mnt/ThingworxStorage ext4 noatime 0 0
#/dev/xvdn /mnt/ThingworxBackupStorage ext4 noatime 0 0
sudo mkdir /mnt/ThingworxStorage
sudo mkdir /mnt/ThingworxBackupStorage
sudo mount /dev/xvdg /mnt/ThingworxStorage
sudo mount /dev/xvdh /mnt/ThingworxBackupStorage
ThingworX Install
Based on Thingworx install info:
# ---System
sudo aptitude update
sudo apt-get install ntp
sudo apt-get install authbind
sudo touch /etc/authbind/byport/443
sudo chmod 555 /etc/authbind/byport/443
# --- Java
# Java:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo update-alternatives --config java
# no change, was ok
sudo update-alternatives --config javac
# no change, was ok
sudo vim /etc/environment
# Insert line at 0 and change PATH:
source /etc/environment
# --- Tomcat 7
# The following are not necessary on a new VM without preinstalled tomcat
sudo apt-get purge tomcat6
sudo apt-get remove tomcat6-common
sudo apt-get remove tomcat7
sudo apt-get remove tomcat7-admin
sudo apt-get remove tomcat7-common
sudo apt-get purge tomcat7-common
sudo apt-get purge tomcat7
sudo apt-get autoremove
tar -xvf apache-tomcat-7.0.55.tar.gz
sudo mv apache-tomcat-7.0.55 /usr/share/tomcat7
cd /usr/share/tomcat7
sudo vim bin/
# Add these lines after initial long comment section:
JAVA_OPTS="$JAVA_OPTS -Dserver -Dd64 -Xms512m -Xmx2g -XX:+UseNUMA -XX:+UseConcMarkSweepGC"
sudo vim bin/
# Change last line (insert the authbind --deep part):
exec authbind --deep "$PRGDIR"/"$EXECUTABLE" start "$@"
sudo vim conf/tomcat-users.xml
# Add in appropriate section:
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="manager-gui"/>
<user username="admin" password="mypasswd" roles="manager,admini,manager-gui"/>
sudo vim conf/context.xml
# Delete the lines before and after the Manager element, basically uncommenting the Manager element - this way, sessions are NOT persisted when Tomcat is restarted
sudo vim conf/server.xml
# Change 8080 to 80 to change the port number tomcat listens on
sudo vim /etc/init.d/tomcat7
# Insert the following (up to and not including --EOF):
# Provides: tomcat7
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Tomcat server
start() {
sh /usr/share/tomcat7/bin/
stop() {
sh /usr/share/tomcat7/bin/
case $1 in
start|stop) $1;;
restart) stop; start;;
*) echo "Run as $0 <start|stop|restart>"; exit 1;;
sudo chmod 755 /etc/init.d/tomcat7
sudo update-rc.d tomcat7 defaults
# Start tomcat (in the future the daemon scripts autostart)
sudo service tomcat7 start
# --- ThingworX webapp installation
Use the browser to go to http://ipaddr - shows Tomcat main page
Select manager or go to http://ipaddr/manager , log in using above admin/thingad7 login
In “WAR file to deploy” section, select Thingworx WAR file and upload
Wait for upload and start of Thingworx webapp. It should appear as started (Stop is a button, Start is text) in the table of Applications on this page.
Go to http://ipaddr/Thingworx and log in as Administrator/admin
Copy link

bauna commented Oct 28, 2014

I have forked your gist and added the steps for using the ubuntu tomcat7 package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment