Apache & Tomcat & Struts Integration Problem

Discussion in 'Java' started by wilson, Aug 15, 2003.

  1. wilson

    wilson Guest

    Hi All

    I hope someone can give me a hand on this. Thanks in advance.
    Environment:
    W2k
    Tomcat 5.0.6
    Apache 2.0
    Struts 1.1
    Mod_jk2-2.0.43.dll (rename to mod_jk2.dll)

    Apache httpd.conf

    LoadModule jk2_module modules/mod_jk2.dll

    DirectoryIndex index.html index.html.var index.jsp

    <VirtualHost *>
    ServerName mywww
    ServerAdmin
    DocumentRoot "C:/jakarta-tomcat-5.0.6/webapps/mywww"

    Alias /tryme "C:/tomcat5_06/webapps/mywww/index.jsp"

    ErrorLog logs/mywww.log
    CustomLog logs/mywww.log common

    <Location "/*.do">
    JkUriSet worker ajp13:localhost:8009
    </Location>
    </VirtualHost>



    workers2.properties

    #
    [common]
    debug=10

    [config]
    debug=10
    debugEnv=10

    [shm]
    file=C:/Program Files/Apache Group/Apache2/logs/shm.file
    size=1048576

    # Define the communication channel
    [channel.socket:localhost:8009]
    info=Ajp13 forwarding over socket
    tomcatId=localhost:8009

    uri:/mywww/*]
    info=Map the whole webapp


    jk2.properties
    all comments out
    # Set the desired handler list
    # handler.list=apr,request,channelJni
    #
    # Override the default port for the socketChannel
    # channelSocket.port=8019
    # Default:
    # channelUnix.file=${jkHome}/work/jk2.socket
    # Just to check if the the config is working
    # shm.file=${jkHome}/work/jk2.shm

    # In order to enable jni use any channelJni directive
    # channelJni.disabled = 0
    # And one of the following directives:

    # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

    # If set to inprocess the mod_jk2 will Register natives itself
    # This will enable the starting of the Tomcat from mod_jk2
    # apr.jniModeSo=inprocess

    server.xml

    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" debug="0"
    protocol="AJP/1.3" />

    <Context path="" docBase="mywww" debug="0"/>
    <Context path="/audioebuy" docBase="mywww" debug="0"/>

    Update the w2k Host file
    Add
    192.168.1.100 mywww


    Invoke the index.JSP direct from Tomcat no problem
    http://localhost:8080/mywww/index.jsp

    Access the index.JSP from Apache no problem
    http://mywww

    Now Modify the index.JSP to include the “Struts” stuff

    <%@ page language="java" %>
    <%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html>

    <html>
    <head>
    <title>Create</title>
    <BR>
    <B> Testing Apache/Tomcat/Struts</B>
    <br>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%" bgcolor="#5E85BF"><html:img page="" height="1"
    width="1"/></td>
    <td><table width="779" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><table width="644" border="0" cellspacing="0"
    cellpadding="0">
    <TR>
    <TD> <font size=+1><B>Here is it No. 3 </B></font></TD>
    <TD> <html:img page="/images/top_links_01.gif"
    alt="Buyers" width="56" height="17"/></TD>
    <TD> <html:img page="images/top_links_02.gif"
    alt="Dealers" width="97" height="17"/></TD>
    </TR>
    </table></td>
    <td><html:img page="/images/login.gif" alt="Login"
    width="135" height="17"/></td>
    </tr>
    </table></td>
    </tr>
    </table>

    </body>
    </html>
    </html:html>

    Invoke the index.JSP with “Struts” directly from Tomcat no
    problem
    http://localhost:8080/mywww/index.jsp


    Access the index JSP with “Struts” from Apache , images
    did not display ?
    http://mywww

    click on view source from the browser
    The taglib was not being processed ?

    <%@ page language="java" %>
    <%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html>

    <html>
    <head>
    <title>Create</title>
    …….
    I have tried http://mywww/tryme with the same result.

    Any clue why the JSP page with Struts forward from the Apache
    wasn’t processed correctly ?
     
    wilson, Aug 15, 2003
    #1
    1. Advertising

  2. wilson

    wilson Guest

    (wilson) wrote in message news:<>...
    > Hi All
    >
    > I hope someone can give me a hand on this. Thanks in advance.
    > Environment:
    > W2k
    > Tomcat 5.0.6
    > Apache 2.0
    > Struts 1.1
    > Mod_jk2-2.0.43.dll (rename to mod_jk2.dll)
    >
    > Apache httpd.conf
    >
    > LoadModule jk2_module modules/mod_jk2.dll
    >
    > DirectoryIndex index.html index.html.var index.jsp
    >
    > <VirtualHost *>
    > ServerName mywww
    > ServerAdmin
    > DocumentRoot "C:/jakarta-tomcat-5.0.6/webapps/mywww"
    >
    > Alias /tryme "C:/tomcat5_06/webapps/mywww/index.jsp"
    >
    > ErrorLog logs/mywww.log
    > CustomLog logs/mywww.log common
    >
    > <Location "/*.do">
    > JkUriSet worker ajp13:localhost:8009
    > </Location>
    > </VirtualHost>
    >
    >
    >
    > workers2.properties
    >
    > #
    > [common]
    > debug=10
    >
    > [config]
    > debug=10
    > debugEnv=10
    >
    > [shm]
    > file=C:/Program Files/Apache Group/Apache2/logs/shm.file
    > size=1048576
    >
    > # Define the communication channel
    > [channel.socket:localhost:8009]
    > info=Ajp13 forwarding over socket
    > tomcatId=localhost:8009
    >
    > uri:/mywww/*]
    > info=Map the whole webapp
    >
    >
    > jk2.properties
    > all comments out
    > # Set the desired handler list
    > # handler.list=apr,request,channelJni
    > #
    > # Override the default port for the socketChannel
    > # channelSocket.port=8019
    > # Default:
    > # channelUnix.file=${jkHome}/work/jk2.socket
    > # Just to check if the the config is working
    > # shm.file=${jkHome}/work/jk2.shm
    >
    > # In order to enable jni use any channelJni directive
    > # channelJni.disabled = 0
    > # And one of the following directives:
    >
    > # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
    >
    > # If set to inprocess the mod_jk2 will Register natives itself
    > # This will enable the starting of the Tomcat from mod_jk2
    > # apr.jniModeSo=inprocess
    >
    > server.xml
    >
    > <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    > <Connector port="8009"
    > enableLookups="false" redirectPort="8443" debug="0"
    > protocol="AJP/1.3" />
    >
    > <Context path="" docBase="mywww" debug="0"/>
    > <Context path="/audioebuy" docBase="mywww" debug="0"/>
    >
    > Update the w2k Host file
    > Add
    > 192.168.1.100 mywww
    >
    >
    > Invoke the index.JSP direct from Tomcat no problem
    > http://localhost:8080/mywww/index.jsp
    >
    > Access the index.JSP from Apache no problem
    > http://mywww
    >
    > Now Modify the index.JSP to include the Struts; stuff
    >
    > <%@ page language="java" %>
    > <%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>
    > <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    > <%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>
    > <html:html>
    >
    > <html>
    > <head>
    > <title>Create</title>
    > <BR>
    > <B> Testing Apache/Tomcat/Struts</B>
    > <br>
    > <table width="100%" border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td width="100%" bgcolor="#5E85BF"><html:img page="" height="1"
    > width="1"/></td>
    > <td><table width="779" border="0" cellspacing="0" cellpadding="0">
    > <tr>
    > <td><table width="644" border="0" cellspacing="0"
    > cellpadding="0">
    > <TR>
    > <TD> <font size=+1><B>Here is it No. 3 </B></font></TD>
    > <TD> <html:img page="/images/top_links_01.gif"
    > alt="Buyers" width="56" height="17"/></TD>
    > <TD> <html:img page="images/top_links_02.gif"
    > alt="Dealers" width="97" height="17"/></TD>
    > </TR>
    > </table></td>
    > <td><html:img page="/images/login.gif" alt="Login"
    > width="135" height="17"/></td>
    > </tr>
    > </table></td>
    > </tr>
    > </table>
    >
    > </body>
    > </html>
    > </html:html>
    >
    > Invoke the index.JSP with Struts; directly from Tomcat no
    > problem
    > http://localhost:8080/mywww/index.jsp
    >
    >
    > Access the index JSP with Struts from Apache , images
    > did not display ?
    > http://mywww
    >
    > click on view source from the browser
    > The taglib was not being processed ?
    >
    > <%@ page language="java" %>
    > <%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>
    > <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    > <%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>
    > <html:html>
    >
    > <html>
    > <head>
    > <title>Create</title>
    > . . . . .
    > I have tried http://mywww/tryme with the same result.
    >
    > Any clue why the JSP page with Struts forward from the Apache
    > wasn’t processed correctly ?


    Corection it should be

    DocumentRoot "C:/tomcat5_06/webapps/mywww"

    Alias /tryme "C:/tomcat5_06/webapps/mywww/index.jsp"
     
    wilson, Aug 16, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos Gravvanis
    Replies:
    0
    Views:
    2,051
    Christos Gravvanis
    Jul 7, 2004
  2. Aleksandar Matijaca
    Replies:
    2
    Views:
    8,324
    Aleksandar Matijaca
    Sep 19, 2004
  3. Thomas S.
    Replies:
    0
    Views:
    597
    Thomas S.
    Nov 12, 2004
  4. Marcin Cenkier
    Replies:
    1
    Views:
    5,428
    Marcin Cenkier
    Apr 12, 2006
  5. Andi
    Replies:
    5
    Views:
    1,335
Loading...

Share This Page