Operating system: CentOS 6 (Virtual host for a job) 1. Install JDK
Method from: http://jingyan.baidu.com/article/4853e1e51d0c101909f72607.html to see if a Java environment is already in place
Yum List installed |grep Java
Uninstall the existing Java environment (I uninstall it because there is no Javac command at all)Uninstall JDK related file input: yum-y remove Java-1. [N].0-openjdk* (N refers to version number) Uninstall Tzdata-java input: Yum-y remove Tzdata-java.noarch
View the Java installation package in the Yum library
Yum-y List java*
Installing the Java Environment
Display multiple versions, select the version you want to install, such as 1.7.0, or 1.8.0
Yum-y install Java-1. [n].0-openjdk*
After the installation is complete, enter Javac to see if there is a compile command, if any, it's done. 2. Install configure Tomcat server, here I install the 7.0 version of the
Go to the Usr/local folder and download the package using the following command
wget http://mirror.olnevhost.net/pub/apache/tomcat/tomcat-7/v7.0.70/bin/apache-tomcat-7.0.70.tar.gz
Then I can hardly Linux, all is Google come, decompression way reference: http://www.centoscn.com/CentOS/help/2013/0725/496.html
Unzip into tar
Gzip-d apache-tomcat-7.0.70.tar.gz
and unzip it into a folder.
Tar xvf Apache-tomcat-7.0.70.tar
See the other tutorial after decompression completed with configuration environment variables, but I did not configure the environment variable or successful, Phuket for Sen Ma. Ask for advice.
So after I unpack, it's only 1 steps from the Tomcat server configuration, which is to open the service and go into the bin folder
Cd/usr/local/apache-tomcat-7.0.70/bin
Start a service
./startup.sh
See this is the start of the complete:
Using catalina_base: /usr/local/apache-tomcat-7.0.70
using catalina_home: /usr/local/ apache-tomcat-7.0.70
using Catalina_tmpdir:/usr/local/apache-tomcat-7.0.70/temp
using jre_home:/ usr
Using CLASSPATH: /usr/local/apache-tomcat-7.0.70/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.70/bin /tomcat-juli.jar
Tomcat started.
You can then enter the native IP address in the browser: 8080 try it, and the success will see the webpage of Tom's cat, such as 127.0.0.1:8080
Of course, the port can be changed, the way to change the port is as follows
Enter Conf folder
Cd/usr/local/apache-tomcat-7.0.70/conf
Edit Server.xml
VI Server.xml
Search 8080 keywords, enter the following command and return
/8080
Should have seen this.
<connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000"
redirectport= "8443"/>
Modify 8080 for the port you want, click I to enter edit mode, and then change the 8080 port, such as 23333. Then press ESC, then press: Key, enter Wq save exit. Complete the port modifications and reboot the Tomcat server.
Restart under the Bin folder. turning off the tomcat server is
./shutdown.sh
This is where a Java Web environment has been built.
Then you can refer to the curriculum of the IMOOC network to try to write the first JSP page.
The address is as follows: http://www.imooc.com/learn/166 end