共用方式為


IIS Tomcat

IIS-Tomcat

Before getting started with IIS -Apache Tomcat we may want to know about some concepts:


 

TOMCAT:

Apache Tomcat (also called Jakarta Tomcat or simply Tomcat) functions as a servlet container developed under the Jakarta project at the Apache Software Foundation. Tomcat implements the servlet and JavaServer Pages (JSP) Oracle Corporation (although created by Sun Microsystems).

We have to have installed JRE:

Concepts:

JRE: Java Runtime Environment. It is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.

JDK: It's the full featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.

Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It's all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK.

 

Sometimes, even though you are not planning to do any Java Development on a computer, you still need the JDK installed. For example, if you are deploying a WebApp with JSP, you are technically just running Java Programs inside the application server. Why would you need JDK then? Because application server will convert JSP into Servlets and use JDK to compile the servlets. I am sure there might be more examples.

 

remark: servlets = applets to be ran.

A Java servlet is a Java program that extends the capabilities of a server. Although servlets can respond to any types of requests, they most commonly implement applications hosted on Web servers..

 

1tomcat

 


 

Diferences between Apache and Tomcat(apache tomcat):

Tomcat works as a container of servlets but today tomcat can now function as an application server alone. apache alone is unable to execute the dynamic content of some pages and that's where tomcat comes to play who facilitates the execution of these servlets or JSPs (these are translated into servlets by tomcat).


 

Documentation to install apache + tomcat https://www.debianhelp.co.uk/apachetomcat.htm https://www.netadmintools.com/art340.html https://www.debianhelp.co.uk/apachetomcat.htm https://wiki.apache.org/tomcat/HowTo

Conector apache--tomcat https://tomcat.apache.org/connectors-doc-archive/jk2/index.html https://tomcat.apache.org/connectors-doc/ https://tomcat.apache.org/tomcat-3.3-doc/mod_jk-howto.html

Conector IIS-Tomcat:   https://tomcat.apache.org/download-connectors.cgi   https://tomcatiis.riaforge.org/

 


 

 

Now Go inside out with IIS- Tomcat:

 

First you must have installed the following:

  • Apache Tomcat
  • JRE/JDK.
  • the right .net framework [as you have IIS server it is obvious you will have it installed already]

 

First install Tomcat 7

Please check wether it is running on port 8080 as it should.

3tomcat

 

Let´s create a site on IIS which will point to the same Tomcat Webroot directory where web content will be executed. Site name TomcatSite.

4tomcat

Add an Index.html to that directory and then test if that run as expected.

5tomcat

if so, create an Index.jsp and add it to the Default documents on IIS server.

6tomcat

This will fail because we have not tomcat IIS connector installed as of yet.

 

7tomcat

 

You can download connector from https://tomcatiis.riaforge.org

 

Follow the wizard and then repro again.

This will recognize now. jsp extensión

8tomcat   All request:

Take into account that the "connector" only will register distinct extensions to be passed to tomcat for processing Eg: .jsp , .cfm , .cfc .

If you may want to request for all kind of extensions, you can add a catch all handler that sends everything to Tomcat by AJP if not recognized.

This technique can be used for servlets and so on.

you must register on IIS server in Handler mappinng * handler and select the connector dll and more below give a handler name.

9tomcat

 

 

If you browse now you can see all kind of allowed content on the browser.

 

something important to keep in mind:

in the Conf directory of the Apache Tomcat you will find this main files for configurations:
1.Server.xml
2.Web.xml
3.Context.xml

please make sure on server.xml file to set the http port.
<Connector port=”${port.http}” protocol=”HTTP/1.1″

connectionTimeout=”20000″

redirectPort=”8443″ />

in context.xml
<Context reloadable=”true“>

and in  web.xml the <init-param> as follow :
<param-value>true</param-value>

 

 

 

If you want to dig deeper into this matter please go here:

 

 Understanding IIS HTTPPlatformHandler using Tomcat 8

Configuring an IIS 7 front-end for Apache Tomcat, using AppCmd.exe

 

Remark: some information I´ve taken from Wikipedia for a better understanding.

Comments

  • Anonymous
    June 24, 2016
    Very detailed information. I am currently exposing a service in Tomcat and would like to leverage Windows Authentication in it. It would be great if Microsoft could provide the ability to use Windows Authentication in Java apps by providing a library. There are a few Java libraries (Spring Auth I believe) that do this but the configuration is not as simple as the configuration setting in ASP.NET - Thanks.
  • Anonymous
    June 25, 2016
    This came in the nick of time to me. thanks a lot!!!!I´m beginer here, could you tell me which main folders tomcat install and what are used for ?
  • Anonymous
    June 25, 2016
    Larry: is the root directory of tomcat. Your Tomcat installation should have the following subdirectories:1.\conf - Where you can place various configuration files2.\webapps - Containing example applications 3.\bin - Where you may place web server pluginsKris:that´s right.thanks so much for that information , I will research about that. In the meantime here is some sumerized tips about IIS Integrated Authentication. http://www.coderanch.com/t/531085/Tomcat/IIS-Integrated-Authentication-Tomcat-Form
  • Anonymous
    August 07, 2016
    Usefull for us to go ahead on our implementation thanks Daniel!!!