×

Loading...

Topic

  • 工作学习 / IT技术讨论 / the prob is when i try to connect Apache with Tomc
    作者:wingslee [10月9日,10:22]

    Hello ,all

    Now, i have intalled Tomcat for Win32. And, Tomcat runs smoothly when configed as a standalone server.

    the prob is when i try to connect Apache with Tomcat( that way, those request for jsp and servlets will be transfered from Apache to Tomcat),there are always error as following

    "Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.....

    "

    and , in the apache's mod_jserv.log, i got following hints.:

    [09/10/2000 01:45:46:490] (EMERGENCY) ajp12: can not connect to host 127.0.0.1:8007
    [09/10/2000 01:45:46:490] (EMERGENCY) ajp12: connection fail
    [09/10/2000 01:45:46:490] (ERROR) an error returned handling request via protocol "ajpv12"


    I have followed the direction of tomcat's DOC and config the ajp12 protocol and port.

    Would u be kind enough to give some advices?
    Regards

    wingslee
    • Mr. Jabber, would u pls give me some advice? my question is in the above post.
      • install steps
        本文发表在 rolia.net 枫下论坛After the Tomcat can work as a standalone server, I make the following changes

        1.modify the tomcat.conf ,which is as following
        ###############################################################################
        # Apache JServ Configuration File #
        ###############################################################################

        # Note: this file should be appended or included into your httpd.conf

        # Tell Apache on win32 to load the Apache JServ communication module
        # LoadModule jserv_module modules/ApacheModuleJServ.dll

        # Tell Apache on Unix to load the Apache JServ communication module
        # For shared object builds only!!!
        # @LOAD_OR_NOT@LoadModule jserv_module @LIBEXECDIR@/mod_jserv.so
        LoadModule jserv_module libexec/mod_jserv.so

        <IfModule mod_jserv.c>
        # Do not edit!
        ApJServManual on
        ApJServDefaultProtocol ajpv12
        ApJServSecretKey DISABLED
        ApJServMountCopy on
        ApJServLogLevel notice


        ### Change if you run tomcat on a different host
        #ApJServDefaultHost localhost
        #ApJServDefaultPort 8007


        #################### All jsp files will go to tomcat ####################
        #ApJServMount default /root

        #AddType text/jsp .jsp
        #AddHandler jserv-servlet .jsp

        ############################## Context mapping - all requests go to tomcat

        ApJServMount /examples ajpv12://localhost:8007/root


        ############################## Context mapping - you need to "deploy"
        # ( copy or ln -s ) the context into htdocs
        ##

        # ApJservMount /CONTEXT/servlet /root
        # <Location /CONTEXT/WEB-INF/ >
        # AllowOverride None
        # deny from all
        # </Location>
        </IfModule>

        2. append the following to the file " httpd.conf " ,which is in the directory "Apache/conf":

        Include d:\jspenv\tomcat\jakarta-tomcat\conf\tomcat-apache.conf

        3.copy the ApacheModuleJserv.dll to the directory :"Apache/modules "

        4.copy d:\jspenv\tomcat\jakarta-tomcat\webapps\examples\*.* to $Apache_home/htdocs/examples

        4.Startup Tomcat

        5.startup Apache

        6.browse those HTML in the directory "
        $Apache_home/htdocs/examples",OK

        7.Try to exec some jsp or servlets , ERROR.

        Thanks for ur kind help更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • IT seems you have made an interesting mistake
      Wingslee

      It seems you are working on Windows platform.

      To connect tp Tomcat, your Apache needs to load jserv_module modules/ApacheModuleJServ.dll.

      However, what you loaded is the corresponding .so file, which is for Unix platform.

      Please correct this and try again.

      Good luck
      • I know what's wrong.
        本文发表在 rolia.net 枫下论坛jabber.

        I check my config carefully, and the prob is as following.

        1.i do my tomcat test on the win98 platform.
        when tomcat starts up, it produce another config file, named tomcat-apache.cfg. In this file , u will find "LoadModule jserv_module modules/ApacheModuleJServ.dll". That way, when apache starts, it can load correct *.dll

        2. I checked for a long time last night, and the real prob is in my server.xml
        *********************************
        <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
        <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
        <Parameter name="port" value="8007"/>
        </Connector>

        ************************************
        when i read this file last night, I mindlessly enter a space before "8007" , so , it become <Parameter name="port" value=" 8007"/>.

        Maybe, Tomcat cann't receive AJP12 Request on Port 8007 correctly, Although i can the Yellow tomcat on Port8080.

        Now, I correct it ,and Apache can cooperate with Tomcat smoothly.

        Thanks更多精彩文章及讨论,请光临枫下论坛 rolia.net
        • Wizi, you are a so experienced guy!
          You have proved your trouble shooting ability.
          It is hard for an employeer to hire a person like you.
          • I am flattered. thanks