Last active
January 10, 2016 15:18
-
-
Save tvhung83/4d4e905f36eed0f2ef5b to your computer and use it in GitHub Desktop.
Vagrantfile ubuntu/trusty64 with Oracle JDK7 and apache tomcat7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 8080, host: 8080 | |
config.vm.synced_folder "./webapps", "/var/lib/tomcat7/webapps", id: "tomcat-webapps", | |
owner: "tomcat7", | |
group: "tomcat7" | |
config.vm.synced_folder "./logs", "/var/log/tomcat7", id: "tomcat-logs", | |
owner: "tomcat7", | |
group: "tomcat7" | |
config.vm.provider "virtualbox" do |vb| | |
# Customize the amount of memory on the VM: | |
vb.cpus = 2 | |
vb.memory = "1024" | |
vb.name = "java-api" | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
echo "INSTALL ORACLE JDK 7" | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections | |
sudo apt-get -y install oracle-java7-installer | |
sudo apt-get -y install oracle-java7-set-default | |
echo "VERIFY JAVA VERSION" | |
java -version | |
sudo apt-get -y install tomcat7 | |
export JAVA_HOME=/usr/lib/jvm/java-7-oracle | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment