Tomcat vs Apache with Tomcat connectors (mod/jk)

Is there any advantage (security, performance etc.) of running a Java web application on Apache HTTP Server with Tomcat Connectors (mod/jk) rather than directly running it on Tomcat.

This question is already answered, see here:
http://tomcat.apache.org/faq/connectors.html
Also for Tomcat/ Apache related questions, post them to the relevant mailing lists.

Similar Messages

  • Integrating Apache with Tomcat?

    Anyone have a guide to integrating Apache with Tomcat using mod_jk?
    I followed some guides online, but they all seem really dated with some obscure references. This seems like it should be on the top of the list....

    Hi Alan.
    I've discovered the exact same problem.... 0.0.0.0 instead of 127.0.0.1
    You've obviously not had any replys here, but di you end up working it out on your own?

  • Apache with Tomcat and dispatcher class.

    I have a MVC design set up with a controller and dispatcher class. I am trynig to forward the results to a specific JSP. If I run the design completely within Tomcat, then everything works great. I have a tomcat site set up called /jsp. My servlet is within the jsp site. So if I do http://localhost:8080/jsp/mypage.jsp it will bring up the page fine. I then submit to and action of /myservlet?action=test. The servlet/dispatcher classes process and forward the request to "/jsp/mypage_result.jsp". All is fine and dandy.
    However, when I try to run this through Apache first let the MOD_JK2 send the JSP/servlet requests to Tomcat the dispatcher doesn't work. I alway get the ERROR 404 page within tomcat (see note 1 below). Even if I use a "./mypage_result.jsp", because the pages are in the same directory, I still the get the error. Can anyone help?
    What I think is happening is that when I make the inital request of http://localhost/jsp/mypage.jsp the request gets sent to Tomcat from Apache. Tomcat processes the jsp page and displays the result to the client. The user submits the data to the servlet (through Apache which pushes it to Tomcat). The servlet/dispatcher code runs and then gets ready to forward the request on. Where I get confused or I am completely guessing is that when the forward method gets called. Does it forward the request on as a HTTP request or as a request within Tomcat? I would guess it is an http request and the request comes in through Apache which (depending on the worker2.properties file) will or will not forward the request to Tomcat. This is where the problem happens. On this forward in the dispatcher class.
    Please help.
    NOTE 1:
    HTTP Status 404 - /mypage_result.jsp
    type Status report
    message /mypage_result.jsp
    description The requested resource (/mypage_result.jsp) is not available.
    Apache Tomcat/4.1.24

    After reading the documentation for the getRequestDispatcher method it seems that the file you are forwarding to must be in the same context. Well if it is in the same context within Tomcat, does it mean it is the same when I am trying to use Apache?
    Anyone out there go this to work?
    Thank you in advance for reading my post.

  • Apache with Tomcat cluster

    Hi, I integrated Apache with Tomcat Cluster on Windows 2000. I instalated mod_jk2.dll, created workers2.properties and configurated server.xml in Tomcat instances. If I try to reach my .jsp file, e.g. http://localhost/root/main.jsp, I get follow message from Tomcat: source root/main.jsp is not available. What�s wrong? Can anybody help me? Apache version: 2.0.47, Tomcat: 1.4.27

    Well, the first order of business is to determine exactly where main.jsp is located. If it is at <CATALINA_HOME>/webapps/main.jsp, then it should be at http://localhost:8080/main.jsp. Bypass Apache and verify that you can get to the Tomcat specific pages first.
    Basically, we're trying to determine a) the correct URL and b) whether the problem is with Tomcat itself, or with the connections between Apache and Tomcat.
    Essentially, we can't tell you where your configuration is incorrect until you tell us what your configuration is. :)

  • Adv. of using apache with tomcat??

    can anyone pl tell me the advantages of using Apache with Tomcat in comarison to other web servers?
    Thanks

    The biggest advantages are that they are open source, so you don't have to pay a huge licence fee, and they are very stable. I don't know how they compare for speed - I know Apache is lightning when it comes to serving flat pages, there are no benchmarks yet for the new Tomcat because it was only released last monday. You can run them on linux or another unix variant, so they are more likely to be secure (windows servers are horrendously open to attack) and stable.

  • Problems configuring XSQL with Tomcat

    Having a lot of trouble getting this to work with tomcat standalone, apache with tomcat, and even apache with resin. (I have successfully gotten this to work with resin as both web and appserver.)
    I have tried to be meticulous in following the directions, but one thing that is throwing me is that I can't find the web.xml file in my xdk distribution (neither in xdk8i nor xdk9i); I've attempted to create the .xsql extension-to-servlet mapping myself in Tomcat's web.xml file, but maybe I got this wrong.
    The main symptom is that my xsql pages are basically being returned to me in the browser. Any help would be appreciated.

    Bacically you need to create yourself, and here is an example:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
    <web-app>
    <servlet>
    <servlet-name>
    WebCounter
    </servlet-name>
    <servlet-class>
    FAQAnswerServlet
    </servlet-class>
    </servlet>
    <servlet>
    <servlet-name>
    oraclexsql
    </servlet-name>
    <servlet-class>
    oracle.xml.xsql.XSQLServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>
    oraclexsql
    </servlet-name>
    <url-pattern>
    *.xsql
    </url-pattern>
    </servlet-mapping>
    </web-app>
    null

  • Do we need appache and ssl work together with tomcat

    Hi all,
    I have experience use tomcate+ sql2000 +JDK to develop and web search site.  Now I hope somebody told me
    1) do I need add apache with tomcat?
    2) do I need to add SSL?
    thank you every much

    Hi all,
    I download mod_jk 1.2.5_2.0.47.dll from (http://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/win32/) rname it as mod_jk.dll and put it down to apache modules, at this step I still get Syntax Ok when I try c:\apache|apache2\bin|Apache.exe -t. but when I add
    <Listener className="org.apache.ajp.tomcat5.config.ApacheConfig" modJk="c:/Apache/Apache2/modules/mod_jk.dll" /> just below the
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    I can't not star my tomcat.
    what is wrong??
    I have apache 2.0.50 and tomcat 5.0.25 on my Pc and before I add apache my tomcat work fine.
    Thank you

  • My webApplication works just with TOMCAT 3

    I've done a web application server/client.
    It's a Servlet and an applet.
    I developed that app with tomcat 3 but with tomcat 4 it does not work.Why?
    I tried to use the manager servlet of TOMCAT 4 for deploing but after installing the web appplication it does not work.

    It 's better but maybe you can help me with this problem.
    I have this web.xml on my web-inf folder:
    <web-app>
    <display-name>Server Application</display-name>
    <description>
         This is a simple web application with a source code organization
         based on the recommendations of the Application Developer's Guide.
    </description>
    <servlet>
    <servlet-name>EchoServlet</servlet-name>
    <servlet-class>EchoServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>EchoServlet</servlet-name>
    <url-pattern>/MM2</url-pattern>
    </servlet-mapping>
    </web-app>
    The problem is that Tomcat 4 cannot find the url pattern /MM2 and so my Servlet.With Tomcat 3 it works.
    I configured the server.xml and web.xml (not the web-inf/web.xml) as the http://www.moreservlets.com/Using-Tomcat-4.html#Enable-Invoker
    author suggested me to do.And with these new features some easy Servlets work correctly.Except my servlet with the url-pattern above specified.Help please!

  • Integrating Web server (eg Apache) with the application server

    I am thinking a project in which I use more static HTML files than JSPs. One way is to use an Apache server to display those HTML files (it should be faster), and deploy the JSPs into the J2EE server; another way is just simple to change the web container�s port to 80 (of the PE 8), and wrap all the files into a war file and deploy it into the application server.
    So can someone advise my which way is better? And if I use the first one, I�d like to know if it is the same way to integrate Apache with Tomcat.
    Thank you very much!

    In the past there has been a belief that the Apache web server serves static content faster than tomcat. Site managers would configure apache to deliver static content and integrate a web container to handle the dynamic content. I believe this argument is losing steam as tomcat gets better. I guess the only way you will know for sure is to deploy your application in PE 8.0 and then in an apache/web container configuration and do some benchmarking. I have no such benchmark data to compare and I base my comments on what I have read in newsgroups over the past months. Personally, I would opt for the app server only setup just to ease configuration. Others may have a different opinion.

  • How to protect an application running on Apache Tomcat app server with OAM 11gR2

    Gurus,
    We have an Apache Tomcat based application named "ABCD" here at client site that we want OAM 11gR2 PS1 to integrate with for SSO purposes. I have successfully configured OHS to reverse proxy requests to Apache Tomcat server whenever somebody tries to access the application URL but still, I am getting the application login page once I have successfully authenticated on OAM SSO login page. The Tomcat based application is authenticating users against a "UserDatabase realm".
    I know in terms of weblogic application, there is an OAM identity asserter provider which then populates the User Principal for the java environment with the authenticated OAM user. But there is no such OAM identity provider for Tomcat.
    So my question is, is there an provider (or Tomcat equivalent) which will entrust authentication to a header, that could be used to populate the Java User Principal from the OAM_REMOTE_USER header? Is the weblogic equivalent of authentication providers present in tomcat as well? Are those called valves?
    Please advise to the earliest.
    Thanks !!

    Aakash,
    I did follow the 4 steps that you mentioned to me. Out of the 4 that you had mentioned, I already had the webgate in place on OHS server and I was already passing the remote_user http header in oam policy as action.
    As part of Step #2: Install mod_jk plugin on OHS server that you mentioned
    1.) I downloaded the tomcat connector - tomcat-connectors-1.2.37-src
    2.) I had to run ./configure,make, make install on my OHS server which runs on RHEL 6. It created the mod_jk.so file. I pasted it in the needed folder.
    3.) I then created the httpd.conf file and workers.properties file as said in the connector docs.
    4.) Restarted OHS.
    As part of Step #3: Configure tomcat's ajp connector that you mentioned and I went through all the links pasted below but didn't find actually what needs to be in place to configure tomcat's ajp connector. I do see in the server.xml of tomcat app server that the ajp 1.3 protocol is supported:
    http://tomcat.apache.org/tomcat-4.0-doc/config/ajp.html
    http://tomcat.apache.org/tomcat-3.3-doc/mod_jk-howto.html#s8
    http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html
    http://www.mulesoft.com/understanding-tomcat-connectors
    <!-- A "Connector" represents an endpoint by which requests are received
             and responses are returned. Documentation at :
             Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
             Java AJP  Connector: /docs/config/ajp.html
             APR (HTTP/AJP) Connector: /docs/apr.html
             Define a non-SSL HTTP/1.1 Connector on port 8080
        -->
        <Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443" />
    <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    Do we need to disable the HTTP protocol in Tomcat and keep only AJP connector enabled? If yes, how to do that?
    I am trying to connect to the application from OHS server like so I am using the http protocal right? How should I use the ajp protocol to connect to tomcat application? 
    http://ohs-host:ohs-port/abcd
    Thanks !!!!!

  • Using tomcat 5 along with apache 2.2

    hi
    i am facing a strange problem
    i am trying to build a web application using servlets with tomcat 5 and apache 2.2 and i am using oracle 10g as the data base
    now when try to access the database from my pc it works fine but when i try to access it from other pc through lan its showing an exception
    i am using mod_jk connector to forward the servlets requests to tomcat.
    log file looks like this
    2009-02-01 00:04:07 StandardContext[manager]HTMLManager: init: Associated with Deployer 'localhost'
    2009-02-01 00:04:07 StandardContext[manager]HTMLManager: init: Global resources are available
    2009-02-01 00:04:07 StandardContext[manager]HTMLManager: list: Listing contexts for virtual host 'localhost'
    2009-02-01 00:04:23 StandardWrapperValve[home]: Servlet.service() for servlet home threw exception
    java.lang.NullPointerException
    at Home.doGet(Home.java:26)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Unknown Source)
    please help me its my semister project
    thanking you

    ronit wrote:
    java.lang.NullPointerException
    at Home.doGet(Home.java:26)Some object reference at the mentioned line inside the mentioned method of the mentioned class is null while the code is trying to access/invoke it.
    The solution should be obvious: make sure that it is not null, or only access/invoke it when it is not null.
    That said, and apart from this specific problem, you should always be placing classes in packages. Not doing so is a bad practice and also asking for trouble.

  • Client authentication with apache+mod_ssl+tomcat

    Hello.
    My question is a little bit off topic.
    I try to read client certificates with request.getAttribute("javax.servlet.request.X509Certificate"), but the result is always null.
    Probably it's null because I have nothing on the session. So my tomcat does not have the certificate. I use apache + mod_ssl + mod_jk + tomcat.
    And here is my question: how did you configured apache and tomcat so that tomcat has the client cert ?
    Thanks.

    usually u generate a keystore for client, and mention that in ur SSL connector of tomcat
    in apache, we need to configure things in ssl.conf

  • Right problem with apache and tomcat

    Bonjour;
    I use a user login "apache" to stop/start Apache and tomcat. Because never launching apache et tomcat as root.
    But I have the following problem with apache (file error.log) :
    [Tue May  6 17:26:22 2003] [error] Connection "warpConnection" cannot connect
    [Tue May  6 17:26:22 2003] [error] Cannot open connection "warpConnection"
    [Tue May  6 17:27:01 2003] [error] Re-Trying to deploy connections
    As root the error msg does'nt exists (lost)
    Best regards;
    A+;

    Run it from the shell to see whats wrong:
    # httpd

  • How to Configure Apache Web Server  with Tomcat web container in Linux

    Hi all,
    I am working on Tomcat web server 5.0.19 on Linux AS 3.0., ( my Control Server)
    I need map my tomcat to Apache Web Server (httpd) in another system
    (web server).
    I dont have jk2_ or jk_mod .so files to use in my tomcat/conf directory to make them available for httpd.conf files of Apache Web server.
    I have only jk2.properties file in my conf.,
    Please tell me how to go about it
    my mail id [email protected]
    Thank You
    Subramanyam.V
    Hyderabad
    India

    The simple answer is to download a web server that has a web container already integrated on it, so all that painful configuration work is avoided.
    You can use the mature SJS Web Server 6.1 SP5 at
    http://www.sun.com/webserver
    Or you can try a preview of the upcoming version at
    http://www.sun.com/download/products.xml?id=446518d5
    You will get better performance and security, with easy of use, at about the same price ;)

  • Apache integrates with Tomcat

    Hi, we have Apache 1.3.19 intergrated with Tomcat 3.2.2 using mod_jk.
    When we checked with the mod_jk.log file, the file size is very large for just turning on it for 5 days. And the contents of this file are repeating the following two lines:
    [jk_uri_worker_map.c (185)]: In jk_uri_worker_map_t::uri_worker_map_free, NULL parameters
    [jk_uri_worker_map.c (335)]: jk_uri_worker_map_t::uri_worker_map_close, NULL parameter
    Can somebody tell me what this two lines mean? The whole file is full of this two lines, nothing else.
    Thanks so much in advance.

    It's just logging from the Apache module which handles the protocol between the web server and the servlet container. Chances are your mod_jk configuration has its logging set higher than you want it -- if it is set to "DEBUG", try turning it down (or off, if you desire).
    Good luck,
    -Derek

Maybe you are looking for

  • Photos missing from catalog list

    Ok, let's see if I can explain my problem.  I had all of my photos saved on an external hard drive.  After recently purchasing Adobe PSE 9, I began to organize all of my photos using PSE.  I had my photos organized into album categories and then brok

  • Creating a Sales Order using Web Dynpro

    Hi SDN,   I want to create a Sales Order using Web Dynpro application. For that i have used "Bapi_Salesorder_Createfromdat2" as a adaptive RFC model. Every thing is fine and i could able to create a sales order for a single line item. But my intensio

  • Adobe Acrobat 9 installation

    Help!! Purchased acrobat 9 pro and can't start.

  • Connection of oracle database in database server from application server

    Hi, I have two servers, one is application server and another one is database server-.. I want to connect oracle 10g database in database server to application server. In application server oracle 10g client is installed--In database server, I have s

  • Long line mangling

    When creating a jar file and specify a class-path for the manifest, the jar utility mangles my nicely-divide lines. For example... Given a manifest file (mani.txt) that includesClass-Path: jar1.jar jar2.jar jar3.jar ...Then running the commands: jar