Skip to content

Instantly share code, notes, and snippets.

@choffee
Created September 14, 2016 10:52
Show Gist options
  • Save choffee/89f633434a24d14639fd84224c5fe4d3 to your computer and use it in GitHub Desktop.
Save choffee/89f633434a24d14639fd84224c5fe4d3 to your computer and use it in GitHub Desktop.
Psi-probe Vagrant box for simple test.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Basic tomcat box running Psi-probe from https://github.com/psi-probe/psi-probe/
# It's an extension to the tomcat manager that is easier to use and has a few
# more features.
Vagrant.configure("2") do |config|
# Ubuntu don't test their builds so this is often broken.
#config.vm.box = "ubuntu/xenial64"
config.vm.box = "geerlingguy/ubuntu1604"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y tomcat7 unzip
echo '<tomcat-users> <role rolename="manager"/> <role rolename="manager-gui"/> <role rolename="probeuser"/> <user username="vagrant" password="vagrant" roles="manager,manager-gui,probeuser"/> </tomcat-users>' >/etc/tomcat7/tomcat-users.xml
chown root:tomcat7 /etc/tomcat7/tomcat-users.xml
chmod 0640 /etc/tomcat7/tomcat-users.xml
cd /var/lib/tomcat7/webapps/
rm -f probe.war sample.war
curl -Lso probe.war https://github.com/psi-probe/psi-probe/releases/download/3.0.0.M3/probe.war
curl -Lso sample.war https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war
service tomcat7 restart
SHELL
config.vm.network "forwarded_port", guest: 8080, host: 8087
# Now you can get to the interface at
# http://localhost:8087/probe
#
# To simulate some load...
# ab -c10 -n 10000 http://localhost:8087/sample/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment