tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Chaney <a...@compulsivecreative.com>
Subject Re: Tomcat is not rendering JSP content on Port 80
Date Tue, 22 Apr 2008 16:01:13 GMT


BeasC wrote:
> My intent is to have an Apache + JK + Tomcat server that uses apache only to
> service static web content and and sends all dynamic content to Tomcat (so
> that it handles all the JSP).  I downloaded and installed Apache 2.2, Tomcat
> 6.0, and J2SE 1.5 (Becuase j2se 1.6 was buggy and giving problems).  When
> initially configuring the server, I included the following lines in the
> Apache HTTPD.conf file:
> 
> LoadModule jk_module modules/mod_jk-1.2.26-httpd-2.2.4.so
> 

Apache 2.2 comes with mod_proxy as default. Either way, you must also 
configure apache to use either mod_jk or mod_proxy.

You are trying to do this by using the 'auto config' mechanism in tomcat.

> and in Tomcat I included:
> 
> <Listener className="org.apache.jk.config.ApacheConfig"
>  modJK="c:/apache/modules/mod_jk-1.2.26-httpd-2.2.4.so" />
> 
> and
> 
> <Listener className="org.apache.jk.config.ApacheConfig" append="true"
>  forwardAll="false"
>  modJK="c:/apache/modules/mod_jk-1.2.26-httpd-2.2.4.so" /
>
I personally have never used this and in the installations which I have 
with Apache 2.2. I use mod_proxy so others may be able to help you more 
here, but I still think that your problem is that your attempt to 
service static documents with apache is overlapping with your attempts 
to serve dynamic information from tomcat.

Have you checked that the workers.properties file is being created 
correctly? What does it have in it?

You have explicitly set forwardAll to false, which is OK, but it also 
means that you must configure apache NOT to look at the same folders 
that you are using for tomcat. See the comment about noRoot and 
forwardAll in the javadocs.

"Warning: When false, some configuration in the web.xml may not be 
duplicated in Apache. Review the mod_jk conf file to see what 
configuration is actually being set in Apache."

It would help if you could give us your folder layout and how you
expect that to map to your url structure.




> Basing most of the tutorials I have read about setting up this type of
> servers, I thought this steps were sufficient to enable the server to work
> in the above descirbed way.  It appears, however, that I am missing
> something...  
> 
Trouble with tutorials is that they are mainly created by people in 
their spare time and they can't possibly cover every variation and 
condition in a world where individual components of a project are 
released on their own timescales and to meet their own objectives. I 
always seem to find something doesn't quite work right when I try to do 
it by rote from a tutorial and I end up debugging it myself, just using 
the tutorial as a guide.


> -Carl
>  
> 
> Alan Chaney wrote:
>> The effect you are observing is because you have configured your setup 
>> to have the jsp files in the path of the document root for apache. 
>> Apache knows nothing about jsp files so it is just returning the source 
>> to you.
>>
>> You have not specified O/S, JVM or Apache or Tomcat version.
>>
>> You might like to read the tomcat documentation before going any further:
>>
>> http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html
>>
>> would be a good place to start if you intend to use apache + tomcat, 
>> together with
>>
>> http://tomcat.apache.org/tomcat-6.0-doc/connectors.html
>>
>> if you want to configure your version of tomcat to directly serve port 
>> 80 and not use apache at all.
>>
>> A 'tomcat only' installation working with port 80 can easily be 
>> configured in Windows using the control panel (or so I believe as I 
>> don't use Windows myself). For a linux setup there are some additional 
>> complications - see:
>>
>> http://commons.apache.org/daemon/index.html
>>
>> to avoid running tomcat as root.
>>
>> Also you may find looking at archives of this list helpful.
>>
>>
>> If you can't find the answers in the above and generally,
>>
>> http://tomcat.apache.org/connectors-doc/index.html
>>
>> then maybe you could specify your system more clearly and I'm sure 
>> people will be able to give you more specific help.
>>
>>
>> Alan Chaney
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> BeasC wrote:
>>> I can get Tomcat to render JSP content if I try to (for example) access
>>> the
>>> JSP installation examples using http://localhost:8080/examples/jsp  But
>>> when
>>> I try to try http://localhost/examples/jsp I get nothing but the raw html
>>> code of the page (of a specific example).
>>> I have an Apache - Tomcat server, and Apache is listening on port 80
>>> (Which
>>> is the default port used when accessing the server using its IP address.
>>> Tomcat has the following code lines in its server.xml file, that I think
>>> might serve as reference point to what I'm talking about:
>>>
>>> <Server port="8005" shutdown="SHUTDOWN">
>>>
>>> and
>>>
>>> <Connector port="8080" protocol="HTTP/1.1" 
>>>                connectionTimeout="20000" 
>>>                redirectPort="8443" /> 
>>>
>>> Any help would be greatly appreciated.
>>>
>>> -Carl
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message