Vagrant Construction (TOMCAT8+JDK7+MYSQL5+DUBBO)
Jdk
1. Download the JDK
2. Unzip the JDK
3. Setting Environment variables
Vim/home/vagrant/.bashrc
This is because I use the vagrant so hint:
The program ' Vim ' can is found in the following packages:* vim* vim-gnome* vim-tiny* vim-athena* vim-gtk
<package>
So to download vim first:
sudo apt-get install vim
If you continue to error, or if you do not connect by URL:
sudo apt-get update
sudo apt-get install vim
Finally try again:
Vim/home/vagrant/.bashrc
Go to the Vim edit page, control or CTRL + D down, to the bottom of the file, keyboard input I into the edit mode, add the following:
Java_home=/home/vagrant/soft/jdk1.8.0_25 path= $PATH: $JAVA _home/bin: $CATALINA _home/bin export Java_home export PATH
Refresh the configuration file, reload
SOURCE ~/.BASHRC
Verify that the installation is successful
[Email protected]:~/soft/jdk1.7.0_79$ java-versionjava Version "1.7.0_79" Java (TM) SE Runtime Environment (build 1.7.0_ 79-B15) Java HotSpot (TM) 64-bit Server VM (build 24.79-b02, Mixed mode)
Tomcat
1. Download Tomcat
2. Unzip Tomcat
TAR-XZVF apache-tomcat-8.0.15.tar.gz
3. Configure Environment variables
Vim/home/vagrant/.bashrc
Append at end of file
catalina_home=/home/vagrant/soft/apache-tomcat-8.0.15 Export Catalina_home
Save the file, reload the configuration file
SOURCE ~/.BASHRC
Verify that the installation is successful
[Email protected]:~/soft/tomcat8.0.28$ sh./bin/startup.sh Using catalina_base: /home/vagrant/soft/ Tomcat8.0.28using catalina_home: /home/vagrant/soft/tomcat8.0.28using catalina_tmpdir:/home/vagrant/soft/ Tomcat8.0.28/tempusing jre_home: /home/vagrant/soft/jdk1.7.0_79using CLASSPATH: /home/vagrant/soft/ Tomcat8.0.28/bin/bootstrap.jar:/home/vagrant/soft/tomcat8.0.28/bin/tomcat-juli.jartomcat started.
4. Open the browser
If it is on the host, no problem, now can be opened, but if the virtual machine built with vagrant, then the following actions are required:
Edit Vagrantfile File:
# Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host Machine. In the example below, # accessing "localhost:8080" would access port on the guest machine. Config.vm.network "Forwarded_port", guest:80, host:8080 # Create A private network, which allows host-only access to The machine # using a specific IP. Config.vm.network "Private_network", IP: "192.168.33.10"
where "forwarded_port" means that the 80 port of the virtual machine is mapped to the 8080 port of the host, that is, if the Tomcat port of the virtual machine defaults to 8080, then the host browser accesses the virtual machine IP ("private_network" setting) : 8080 to access Tomcat WebApp
After setting, restart the virtual machine:
Vagrant Reload
Vagrant Build UBUNTU-JAVAEE development environment--tomcat+jdk+mysql+dubbo+ test