I'm sorry I have to blog in English,for I haven't install Chinese input method in Ubuntu.
Using Linux is a little different from Windows. For one thing, you cannot copy or move files and directories at will.So it does bothered me a lot at the beginning.
Here I want to show you how to install apache-tomcat in Ubuntu and run a hello world web application.
Before starting, you don't have to worry about JDK, for Ubuntu has already installed it (Open JDK1.6.0_24 Ubuntu-12.0.4)
Step1: Download apache-tomcat from official website: http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-7/v7.0.34/bin/apache-tomcat-7.0.34.tar.gz
Step2: Extract it to your favorite path.
Step3: Start tomcat server in Shell.
1: Open Terminal ( Ctrl+Alt+T)
2: Locate to apache tomcat bin directory
3: start server by inputting ./startup.sh (startup.bat for windows)
if you see this prints out in your terminal,then you have successfully start tomcat server.
root@ubuntu:/home/tsb/Desktop/apache-tomcat-7.0.34/bin# ./startup.sh
Using CATALINA_BASE: /home/tsb/Desktop/apache-tomcat-7.0.34
Using CATALINA_HOME: /home/tsb/Desktop/apache-tomcat-7.0.34
Using CATALINA_TMPDIR: /home/tsb/Desktop/apache-tomcat-7.0.34/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/tsb/Desktop/apache-tomcat-7.0.34/bin/bootstrap.jar:/home/tsb/Desktop/apache-tomcat-7.0.34/bin/tomcat-juli.jar
Step4: Test http://localhost:8080 in FireFox browser:
If you see this familiar icon cat, then congratulation to you.
Last let's write a sample web application which we call it Hello World.
First locate to webapps directory, and copy ROOT directory and paste it in the same directory , rename it to hello. In hello directory, we just edit the index.jsp file as follow:
<html>
<body>
Hello World! <%=new java.util.Date().toGMTString() %>
</body>
</html>
To test it in your web browser, simply write http://localhost:8080/hello/index.jsp.
Finally, if you want to stop the server.Just write ./shutdown.sh in you terminal.
root@ubuntu:/home/tsb/Desktop/apache-tomcat-7.0.34/bin# ./shutdown.sh
Using CATALINA_BASE: /home/tsb/Desktop/apache-tomcat-7.0.34
Using CATALINA_HOME: /home/tsb/Desktop/apache-tomcat-7.0.34
Using CATALINA_TMPDIR: /home/tsb/Desktop/apache-tomcat-7.0.34/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/tsb/Desktop/apache-tomcat-7.0.34/bin/bootstrap.jar:/home/tsb/Desktop/apache-tomcat-7.0.34/bin/tomcat-juli.jar
And I'm just a elementary programmer who loves java and web programming. Thanks for your click.