Presentation is loading. Please wait.

Presentation is loading. Please wait.

Apache Tomcat Web Server MOHD NORFAIZI MIHSANY (A91391)

Similar presentations


Presentation on theme: "Apache Tomcat Web Server MOHD NORFAIZI MIHSANY (A91391)"— Presentation transcript:

1 Apache Tomcat Web Server MOHD NORFAIZI MIHSANY (A91391)

2 Web Server Used application server locate at technician room. Used application server locate at technician room. 202.185.47.240 202.185.47.240

3 Architecture

4 Server Setup Step by Step Download and install the Java Software Development Kit (SDK). Download and install the Java Software Development Kit (SDK). Download Server Download Server Configure the Server Configure the Server Set up Development Environment Set up Development Environment Test Test

5 Download and Install Java Software Development Kit (SDK) http://java.sun.com/j2se/1.4.2/in dex.jsp http://java.sun.com/j2se/1.4.2/in dex.jsp Download the setup. Download the setup. Install the SDK. Install the SDK.

6 Download a Server Apache Tomcat, Macromedia JRun, Jetty, Microsoft IIS, iPlanet/Sun ONE Server and Apache Server. Apache Tomcat, Macromedia JRun, Jetty, Microsoft IIS, iPlanet/Sun ONE Server and Apache Server. Apache Tomcat 4.0 (http://jakarta.apache.org/tomcat) was used for this project. Apache Tomcat 4.0 (http://jakarta.apache.org/tomcat) was used for this project. Apache Tomcat 4.0 is the official reference implementation for Servlet 2.3 and JSP 1.2. Apache Tomcat 4.0 is the official reference implementation for Servlet 2.3 and JSP 1.2. It’s entirely free and has complete source code available. It’s entirely free and has complete source code available.

7 Configuring Apache Tomcat Setting the JAVA_HOME variable. Setting the JAVA_HOME variable. Specifying the server port. Specifying the server port. Enabling servlet reloading. Enabling servlet reloading. Enabling the ROOT context. Enabling the ROOT context. Turning on the invoker servlet. Turning on the invoker servlet. Increasing DOS memory limits (older windows). Increasing DOS memory limits (older windows). Setting CATALINA_HOME (optional). Setting CATALINA_HOME (optional).

8 Setting the JAVA_HOME Variable Right click My Computer. Right click My Computer. Select Properties. Select Properties. Select Advance. Select Advance. Select Environment Variable. Select Environment Variable. Add JAVA_HOME value and click OK. Add JAVA_HOME value and click OK. Another way by edit install_dir/bin/catalina.bat and insert this line Another way by edit install_dir/bin/catalina.bat and insert this line set JAVA_HOME=C:\J2sdk1.4.0

9

10

11 Specifying the Server Port By default, Apache Tomcat used port 8080. By default, Apache Tomcat used port 8080. Modifying the port number involves editing install_dir/conf/server.xml. Modifying the port number involves editing install_dir/conf/server.xml.

12 The original element will look something like this : <Connector className=“org.apache.coyote.tomcat4.CoyoteConnector” port=“8080” minProcessors=“5” maxProcessors=“75” …. /> After <Connector className=“org.apache.coyote.tomcat4.CoyoteConnector” port=“80” minProcessors=“5” maxProcessors=“75” …. />

13 Enabling Servlet Reloading To turn on servlet reloading, edit install_dir/conf/server.xml. To turn on servlet reloading, edit install_dir/conf/server.xml. Find Find <!-- Define properties for each web application. … …. --> Insert following line just below it Insert following line just below it

14 Enabling the ROOT Context Edit install_dir/conf/server.xml. Edit install_dir/conf/server.xml. Uncomment the following line Uncomment the following line

15 Turning On the Invoker Servlet Edit install_dir/conf/web.xml. Edit install_dir/conf/web.xml. Uncomment following line Uncomment following line<servlet-mapping><servlet-name>invoker</servlet-name><url-pattern>/servlet/*</url-pattern></servlet-mapping>

16 Increasing DOS Memory Limits For old version of Windows like windows 98. For old version of Windows like windows 98. Right click install_dir/bin/startup.bat. Right click install_dir/bin/startup.bat. Select properties. Select properties. Select memory and change the Initial Environment from Auto to at least 2816. Select memory and change the Initial Environment from Auto to at least 2816.

17 Setting CATALINA_HOME Right click My Computer. Right click My Computer. Select Properties. Select Properties. Select Advance. Select Advance. Select Environment Variable. Select Environment Variable. Add CATALINA_HOME value and click OK. Add CATALINA_HOME value and click OK.

18 Test your Setup Double click on install_dir/bin/startup.bat. Double click on install_dir/bin/startup.bat. Open browser and enter Open browser and enterHttp://localhost

19

20 Using The Default Web Application Packageless Servlet Packageless Servlet code : install_dir/webapps/ROOT/WEB-INF/classes URL: http://host:port/servlet/ServletName Packaged Servlet Packaged Servlet code: install_dir/webapps/ROOT/WEB-INF/ classes/packagename URL: http://host:port/servlet/packageName.ServletName

21 Using The Default Web Application Packaged Beans and Utility Classes Packaged Beans and Utility Classes install_dir/webapps/ROOT/WEB-INF/ classes/packageName JAR Files JAR Files install_dir/webapps/ROOT/WEB-INF/lib

22 Using The Default Web Application HTML and JSP (Not In Subdirectories) HTML and JSP (Not In Subdirectories) code: install_dir/webapps/ROOT URL: http://host:port/filename HTML and JSP (In Subdirectories) HTML and JSP (In Subdirectories) code: install_dir/webapps/ROOT/directoryName URL: http://host:port/directoryNme/filename

23 Servlet and JSP APIs Install_dir/webapps/tomcat- docs/servletapi/index.html Install_dir/webapps/tomcat- docs/servletapi/index.html

24 CLASSPATH Set CLASSPATH in Environment Variable. Set CLASSPATH in Environment Variable. Have it include installdir/common/lib/servlet.jar. Have it include installdir/common/lib/servlet.jar. For compile Servlet application. For compile Servlet application.

25 Traceroute http://mips.myloca.com/trace http://mips.myloca.com/trace

26 Reference Marty Hall, Larry Brown. 2004. Core Servlets and JavaServer Pages. Second Edition. U.S.A: Prentice Hall. Marty Hall, Larry Brown. 2004. Core Servlets and JavaServer Pages. Second Edition. U.S.A: Prentice Hall. Marty Hall. 2005. Apache Tomcat Tutorial. (online) http://www.coreservlets.com/Ap ache-Tomcat-Tutorial (10 March 2005) Marty Hall. 2005. Apache Tomcat Tutorial. (online) http://www.coreservlets.com/Ap ache-Tomcat-Tutorial (10 March 2005)


Download ppt "Apache Tomcat Web Server MOHD NORFAIZI MIHSANY (A91391)"

Similar presentations


Ads by Google