You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by rm...@hire.com on 2003/08/20 18:08:56 UTC

Processing .html files like JSPs

In the app I'm working on there's a number JSP files that actually have the extension .html.  Is there a way to configure Tomcat to treat these files just as if they had the standard .jsp extension, or do I need to rely on Apache rewrite rules?

I'm using Tomcat 4.1.27 on Linux.

JK directives in httpd.conf

Posted by Alberto Puerta <ap...@renr.es>.
Hello all.

I've the same problem descrived in
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html when
the ajp13 connector can't find a virtual host that matches a uri, and i want
to allow tomcat to serve all jsp pages without checking the servername
because this is what did before apache.

But i got errors in log, and Internal Server Error in web:

msgAjp.receive(): Bad signature 0 0
channelSocket.receive(): Bad header
workEnv.processCallbacks() Error reading reply
ajp13.service() ajpGetReply recoverable error 120000
ajp13.service() Error forwarding ajp13:localhost:8013 1 0
mod_jk.handler() Error connecting to tomcat 120000


Here's my vhosts.conf

NameVirtualHost 10.162.120.22
<VirtualHost 10.162.120.22>
    DocumentRoot /usr/local/datos/www/www.diarioinformacion.com
    ServerName www.diarioinformacion.com:80
    ErrorLog /var/log/apache/www.diarioinformacion.com-error.log
  <Location "/*.jsp">
     JkUriSet worker ajp13:localhost:8009
  </Location>
</VirtualHost>

NameVirtualHost 10.162.120.42
<VirtualHost 10.162.120.42>
    DocumentRoot /usr/local/datos/www/www.laopiniondezamora.es
    ServerName www.laopiniondezamora.es:80
    ErrorLog /var/log/apache/www.laopiniondezamora.es-error.log
  <Location "/*.jsp">
     JkUriSet worker ajp13:localhost:8010
  </Location>
</VirtualHost>


And here's my workers2.properties:

[shm]
file=/usr/local/software/apache/logs/shm.file
size=1048576

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

[channel.socket:localhost:8010]
port=8010
host=127.0.0.1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[ajp13:localhost:8010]
channel=channel.socket:localhost:8010

[uri:www.diarioinformacion.com/*.jsp]
group=ajp13:localhost:8009

[uri:proinf02.renr.es/*.jsp]
group=ajp13:localhost:8009

[uri:10.162.120.22/*.jsp]
group=ajp13:localhost:8009

[uri:www.laopiniondezamora.es/*.jsp]
group=ajp13:localhost:8010

[uri:10.162.130.41/*.jsp]
group=ajp13:localhost:8010

[uri:prozam02.renr.es/*.jsp]
group=ajp13:localhost:8010

[uri:10.162.120.42/*.jsp]
group=ajp13:localhost:8010

[uri:213.0.95.41/*.jsp]
group=ajp13:localhost:8010


Thanks a lot.



JK directives in httpd.conf

Posted by Alberto Puerta <ap...@renr.es>.
Hello all.

I've the same problem descrived in
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html when
the ajp13 connector can't find a virtual host that matches a uri, and i want
to allow tomcat to serve all jsp pages without checking the servername
because this is what did before apache.

But i got errors in log, and Internal Server Error in web:

msgAjp.receive(): Bad signature 0 0
channelSocket.receive(): Bad header
workEnv.processCallbacks() Error reading reply
ajp13.service() ajpGetReply recoverable error 120000
ajp13.service() Error forwarding ajp13:localhost:8013 1 0
mod_jk.handler() Error connecting to tomcat 120000


Here's my vhosts.conf

NameVirtualHost 10.162.120.22
<VirtualHost 10.162.120.22>
    DocumentRoot /usr/local/datos/www/www.diarioinformacion.com
    ServerName www.diarioinformacion.com:80
    ErrorLog /var/log/apache/www.diarioinformacion.com-error.log
  <Location "/*.jsp">
     JkUriSet worker ajp13:localhost:8009
  </Location>
</VirtualHost>

NameVirtualHost 10.162.120.42
<VirtualHost 10.162.120.42>
    DocumentRoot /usr/local/datos/www/www.laopiniondezamora.es
    ServerName www.laopiniondezamora.es:80
    ErrorLog /var/log/apache/www.laopiniondezamora.es-error.log
  <Location "/*.jsp">
     JkUriSet worker ajp13:localhost:8010
  </Location>
</VirtualHost>


And here's my workers2.properties:

[shm]
file=/usr/local/software/apache/logs/shm.file
size=1048576

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

[channel.socket:localhost:8010]
port=8010
host=127.0.0.1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[ajp13:localhost:8010]
channel=channel.socket:localhost:8010

[uri:www.diarioinformacion.com/*.jsp]
group=ajp13:localhost:8009

[uri:proinf02.renr.es/*.jsp]
group=ajp13:localhost:8009

[uri:10.162.120.22/*.jsp]
group=ajp13:localhost:8009

[uri:www.laopiniondezamora.es/*.jsp]
group=ajp13:localhost:8010

[uri:10.162.130.41/*.jsp]
group=ajp13:localhost:8010

[uri:prozam02.renr.es/*.jsp]
group=ajp13:localhost:8010

[uri:10.162.120.42/*.jsp]
group=ajp13:localhost:8010

[uri:213.0.95.41/*.jsp]
group=ajp13:localhost:8010


Thanks a lot.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Processing .html files like JSPs

Posted by Tim Funk <fu...@joedog.org>.
The quick way (but there are other ways too)

In $TOMCAT_HOME/conf/web.xml
   <servlet-mapping>
     <servlet-name>jsp</servlet-name>
     <url-pattern>*.jsp</url-pattern>
   </servlet-mapping>
ADD
   <servlet-mapping>
     <servlet-name>jsp</servlet-name>
     <url-pattern>*.html</url-pattern>
   </servlet-mapping>

-Tim

rmusser@hire.com wrote:
> In the app I'm working on there's a number JSP files that actually have the extension .html.  Is there a way to configure Tomcat to treat these files just as if they had the standard .jsp extension, or do I need to rely on Apache rewrite rules?
> 
> I'm using Tomcat 4.1.27 on Linux.
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Processing .html files like JSPs

Posted by Tim Funk <fu...@joedog.org>.
The quick way (but there are other ways too)

In $TOMCAT_HOME/conf/web.xml
   <servlet-mapping>
     <servlet-name>jsp</servlet-name>
     <url-pattern>*.jsp</url-pattern>
   </servlet-mapping>
ADD
   <servlet-mapping>
     <servlet-name>jsp</servlet-name>
     <url-pattern>*.html</url-pattern>
   </servlet-mapping>

-Tim

rmusser@hire.com wrote:
> In the app I'm working on there's a number JSP files that actually have the extension .html.  Is there a way to configure Tomcat to treat these files just as if they had the standard .jsp extension, or do I need to rely on Apache rewrite rules?
> 
> I'm using Tomcat 4.1.27 on Linux.
>  


RE: Processing .html files like JSPs

Posted by Shawn Zernik <sz...@internetworkconsulting.net>.
It should have some setting in your web.xml to configure you context: exact
syntax, I'm unsure.  Look for "context" documentation.

Shawn Zernik
Internetwork Consulting
www.internetworkconsulting.net

-----Original Message-----
From: rmusser@hire.com [mailto:rmusser@hire.com]
Sent: Wednesday, August 20, 2003 11:09 AM
To: tomcat-user@jakarta.apache.org
Subject: Processing .html files like JSPs


In the app I'm working on there's a number JSP files that actually have the
extension .html.  Is there a way to configure Tomcat to treat these files
just as if they had the standard .jsp extension, or do I need to rely on
Apache rewrite rules?

I'm using Tomcat 4.1.27 on Linux.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Processing .html files like JSPs

Posted by Shawn Zernik <sz...@internetworkconsulting.net>.
It should have some setting in your web.xml to configure you context: exact
syntax, I'm unsure.  Look for "context" documentation.

Shawn Zernik
Internetwork Consulting
www.internetworkconsulting.net

-----Original Message-----
From: rmusser@hire.com [mailto:rmusser@hire.com]
Sent: Wednesday, August 20, 2003 11:09 AM
To: tomcat-user@jakarta.apache.org
Subject: Processing .html files like JSPs


In the app I'm working on there's a number JSP files that actually have the
extension .html.  Is there a way to configure Tomcat to treat these files
just as if they had the standard .jsp extension, or do I need to rely on
Apache rewrite rules?

I'm using Tomcat 4.1.27 on Linux.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org