2014年2月20日 星期四

Ubuntu Install Tomcat

1. Install Tomcat
$ sudo apt-get install tomcat7
2. Check Status
$ sudo /etc/init.d/tomcat7 status
* Tomcat servlet engine is running with pid 13249
3. Install mysql-connector-java
$ sudo cp mysql-connector-java-5.1.22-bin.jar /usr/share/tomcat7/lib/
4. Restart Tomcat
$ sudo /etc/init.d/tomcat7 restart
* Stopping Tomcat servlet engine tomcat7 [ OK ]
* Starting Tomcat servlet engine tomcat7 [ OK ]
5. Test
$ cd /var/lib/tomcat7/webapps/ROOT
$ sudo vim test1.jsp
test1.jsp:
<%
out.println("Hello World!");
%>
6. Open browser
http://<your_server_ip_address>:8080/test1.jsp
will show
Hello World!
7. cd /usr/share/tomcat7/lib
8. $ sudo cp servlet-api.jar jsp-api.jar el-api.jar /usr/lib/jdk/jdk1.7.0_51/jre/lib/ext/

沒有留言:

張貼留言