Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Apache & Tomcat & Struts Integration Problem

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Tomcat - Client Authentication - LDAP  
Author Message
wswwong

External


Since: Aug 15, 2003
Posts: 2



(Msg. 1) Posted: Fri Aug 15, 2003 1:13 pm
Post subject: Apache & Tomcat & Struts Integration Problem
Archived from groups: comp>lang>java>programmer, others (more info?)

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 admin RemoveThis @mywww.com
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
<a style='text-decoration: underline;' href="http://localhost:8080/mywww/index.jsp" target="_blank">http://localhost:8080/mywww/index.jsp</a>

Access the index.JSP from Apache no problem
<a style='text-decoration: underline;' href="http://mywww" target="_blank">http://mywww</a>

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
<a style='text-decoration: underline;' href="http://localhost:8080/mywww/index.jsp" target="_blank">http://localhost:8080/mywww/index.jsp</a>


Access the index JSP with “Struts” from Apache , images
did not display ?
<a style='text-decoration: underline;' href="http://mywww" target="_blank">http://mywww</a>

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 <a style='text-decoration: underline;' href="http://mywww/tryme" target="_blank">http://mywww/tryme</a> with the same result.

Any clue why the JSP page with Struts forward from the Apache
wasn’t processed correctly ?<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Apache & Tomcat & Struts Integration Problem 
Back to top
Login to vote
wswwong

External


Since: Aug 15, 2003
Posts: 2



(Msg. 2) Posted: Sat Aug 16, 2003 6:49 am
Post subject: Re: Apache & Tomcat & Struts Integration Problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wswwong.DeleteThis@hotmail.com (wilson) wrote in message news:<bf25b803.0308150913.10526ca.DeleteThis@posting.google.com>...
 > 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 admin.DeleteThis@mywww.com
 > 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
<font color=purple> > <a style='text-decoration: underline;' href="http://localhost:8080/mywww/index.jsp</font" target="_blank">http://localhost:8080/mywww/index.jsp</font</a>>
 >
 > Access the index.JSP from Apache no problem
 > <a style='text-decoration: underline;' href="http://mywww" target="_blank">http://mywww</a>
 >
 > 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
<font color=purple> > <a style='text-decoration: underline;' href="http://localhost:8080/mywww/index.jsp</font" target="_blank">http://localhost:8080/mywww/index.jsp</font</a>>
 >
 >
 > Access the index JSP with Struts from Apache , images
 > did not display ?
<font color=purple> > <a style='text-decoration: underline;' href="http://mywww</font" target="_blank">http://mywww</font</a>>
 >
 > 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 <a style='text-decoration: underline;' href="http://mywww/tryme" target="_blank">http://mywww/tryme</a> 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"<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Apache & Tomcat & Struts Integration Problem 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Tomcat Servlet deployment problem - Hello, I am not too familar with Apache, so I am going to try to describe my problem as clear as possible, but I may leave out something critical due to my lack of experience with Apache. If I do please let me know. I have a servlet that we coded and..

Tomcat 4 and Apache - Hello all. I worked with Apache and Tomcat 3 for a while but never got around to Tomcat 4. My question is how do Apache and Tomcat 4 work together? Is Tomcat 4 a web and app server in one, or maybe Apache has to be configured to send requests to..

Apache+Tomcat+Cocoon - Anyone ever get those 3 latest-stable release ever work? I got Apache+Tomcat works fine. But I can't get Cocoon to work. All I got when I did http://localhost:8080/cocoon is a directory listing. Helps are greatly appreciated. PS: Its too confusing to....

apache 1.3.27 + mod_jk 1.1.0 + jakarta tomcat 4.1.27 - Hi I just tries to upgrade my tomcat 4.1.18-LE-jdk141 to 4.1.27-LE-jdk141 but fails 'cause $CATALINA_HOME/conf/jk/workers.properties is missing in 4.1.27. Does any one know why they removed this from the tar ball ? (binary, downloaded from apache..

Apache on Linux and Tomcat in Windows - Hello, my problem is to configure a apache webserver so, that it is using a tomcat servlet engine, that runs on an other machine wihich has windows as its os. Apache by itself runs under linux. Can anyone please help me. I am an newbie in this sector bu...
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]