Installing Apache Tomcat Server

Installing Apache Tomcat Server

 

 

Steps to install Apache Tomcat Server

 

§  Create a directory

o   (In c: as WTServlets)

 

§  Download and Install Tomcat in above folder

o   In  http://tomcat.apache.org find latest version of tomcat. Under Binary Distributions Core find the "zip". Download and extract to WTServlets folder

 

§  Download and install the latest versions of jdk and jre. Create an Environment Variable JAVA_HOME and JRE_HOME as below.

(JAVA_HOME= C:\Program Files\Java\jdk1.8.0_221)

(JRE_HOME= C:\Program Files\Java\jre1.8.0_221)



§  Configure the Tomcat Server

o   The Tomcat configuration files, in XML format, are located in the "conf" sub-directory of the installed Tomcat directory

o   Configure the TCP port number and enable automatic reload and listings.

 

§  server.xml – Set the TCP Port Number

In <Connector port="xxxx" protocol="HTTP/1.1"           connectionTimeout="20000"           redirectPort="8443" />

Set xxxx value (Example: port=”8088”)

 


 

§  context.xml – Enabling Automatic Reload

add the attribute reloadable="true" to the <Context> element to enable automatic reload after code changes.

<Context reloadable="true">
   ......
   ......
</Context>

 

§  web.xml – Enable Directory Listing

enable directory listing by changing "listings" from "false" to "true" for the "default" servlet

<servlet>
  <servlet-name>default</servlet-name>
  <servlet-class>org.apache.catalina.
servlets.DefaultServlet</servlet-class>
  <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
  </init-param>
  <init-param>
    <param-name>listings</param-name>
    <param-value>true</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

 

 

§  Start Tomcat Server

o   In command prompt go to c:\WTServlets\apache-tomcat-9.0.24\bin type startup

o   c:\WTServlets\apache-tomcat-9.0.24\bin>startup

xxxxx INFO [main] org.apache.catalina.startup.Catalina.start Server startup in […..] ms

 

§  Start client access to server

o  Open any browser and access the tomcat server by adding http://localhost:8088 at the address bar


§  Shutdown

o   In command prompt go to c:\WTServlets\apache-tomcat-9.0.24\bin type shutdown

o   c:\WTServlets\apache-tomcat-9.0.24\bin>shutdown

 

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu