Server is Ubuntu server 12.04 LTS 64bit
All operations assume that you already have root privileges, if you do not need to add sudo.
I. Installing the JDK
1. Go to Oracle official website to download Jdk-6u45-linux-x64.bin, I was through windows good through SSH to the server.
2. Create a folder/installed/java in/usr/local, and then upload the next good file to the folder.
3.cd/usr/local/installed/java, and then change the file execution permissions chmod 777 Jdk-6u45-linux-x64.bin
4. Run the file./jdk-6u45-linux-x64.bin.
5. Configure the environment variable Vi/etc/profile
Increase on the last side of the file:
Export java_home=/usr/local/installed/java/jdk1.6.0_45
Export path= $JAVA _home/bin: $PATH
Modify the system default JDK (if no other version of the JDK is pre-installed on the system to ignore this step):
Update-alternatives--install/usr/bin/java Java/usr/local/installed/java/jdk1.6.0_45/bin/java 300
Update-alternatives--install/usr/bin/javac Javac/usr/local/installed/java/jdk1.6.0_45/bin/javac 300
Update-alternatives--config Java
Update-alternatives--config Javac
Detect Java version, enter java-version
Two. Installing TOMCAT7
1. Download Tomcat7 apache-tomcat-7.0.47.tar.gz
2. Unzip to local, modify folder name to Tomcat
3. Add Administrator privileges: Modify the Tomcat-users.xml file under Tomcat\conf, add the following in the <tomcat-users> tab
<role rolename= "Manager-gui"/>
<role rolename= "Manager-script"/>
<role rolename= "Manager-jmx"/>
<role rolename= "Manager-status"/>
<role rolename= "Admin-script"/>
<role rolename= "Admin-gui"/>
<user name= "admin" password= "admin" roles= "Manager-gui,manager-script,manager-jmx,manager-status,admin-gui, Admin-script "/>
4. Modify the TOMCAT environment variable: Modify catalina.sh under Tomcat/bin (the server running under Windows modifies the corresponding bat). Add to
Catalina_home=/usr/local/installed/tomcat
java_home=/usr/local/installed/java/jdk1.6.0_45/
Tomcat recommends that the environment parameters be managed in the setenv.sh file, but because there are not so many configuration items, the two parameters are temporarily placed in the catalina.sh.
5. Move the folder tomcat to the/usr/local/installed directory in Ubuntu server via SSH
6. Add catalina_home environment variable: first Vi/etc/profile
And then add
Export Catalina_home=/usr/local/installed/tomcat
And then source/etc/profile to make it come into effect
7. Launch Tomcat view page
Install JDK and TOMCAT7 under Ubuntu server