You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luis Villa <lv...@gmail.com> on 2008/06/02 09:35:12 UTC
Re: Tomcat, iis connector and case sensitivity
All right, I'm officially a complete newbie to tomcat and iis. I can't
understand why my configuration is not working, and I find Tomcat
documentation excessively brief :S
Where do I put the rewrite rules? In isapi_redirect.properties?
I tried to put it there, I tried to put it in rewrite_rules.properties and
set rewrite_rule_file variable in isapi_redirect.properties, with the same
result: It never uses my new created rules.
The configuration I have now is:
isapi_redirect.properties:
# Full path to the rewrite_rules.properties file
rewrite_rule_file=c:\apache-tomcat-6.0.14\conf\rewrite_rules.properties
rewrite_rules.properties
/myapplication/=/MyApplication/
/MYAPPLICATION/=/MyApplication/
but despite this, I can only enter my application with "
http://localhost:8080/MyApplication", not with "
http://localhost:8080/myapplication".
What am I doing wrong?
Thank you all
Regards
Re: Tomcat, iis connector and case sensitivity
Posted by André Warnier <aw...@ice-sa.com>.
Luis Villa wrote:
> Hello André, thanks for your answer,
>
> My configuration is:
>
>
> - tomcat 6
> - IIS 6
> - Windows 2003 server SP1
> - tomcat connector 1.2.26
>
> When I ask for MYAP, it doesn't appear a IIS screen, but a Tomcat error. So,
> I assumed the connector was correctly deriving the requests from IIS to
> Tomcat.
>
And you probably then assume correctly.
In the Tomcat error page, do you see anything that shows which URL it is
trying to handle, and is it the "untranslated" one ?
If not in the Tomcat error page, then some Tomcat log should show which
URL it is trying to process. You may have to enable the "Access Log
Valve" for that.
(In one Tomcat 5.5 config I have, the following is defined in the
server.xml, inside the respective <Host> container :
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access" suffix=".log"
rotatable="false" pattern="common" resolveHosts="false"/>
)
Of course, a quick and dirty fix would probably be to modify the web.xml
of your application, to match the various URIs you can get, like :
instead of
<url-pattern>MyApplication</url-pattern>
make it
<url-pattern>MyApplication</url-pattern>
<url-pattern>MYAPP</url-pattern>
<url-pattern>MYAPPLICATION</url-pattern>
<url-pattern>myapplication</url-pattern>
etc..
(you have to verify, but I think the <url-pattern> can be repeated.)
Maybe also (since it's called "url-pattern"), this is a regexp, in which
case there might be a more elegant way to specify this.
André
>
> 2008/6/16 André Warnier <aw...@ice-sa.com>:
>
>>
>> Luis Villa wrote:
>>
>>> Hello all,
>>>
>>> I'm trying to add redirect rules to the tomcat connector. I've been
>>> reading
>>> Tomcat connector documentation, and what I've done till the moment is
>>> this:
>>>
>>> 1.- I've created a rewrite_rules.properties with this content:
>>>
>>> /myapplication/=/MyApplication/
>>> /MYAPPLICATION/=/MyApplication/
>>> /MYAP/=/MyApplication/
>>>
>>> 2.- I've added this to isapi_redirect.properties:
>>>
>>> # Full path to the rewrite_rules.properties file
>>>
>>> rewrite_rule_file=c:\apache-tomcat-6.0.14\conf\rewrite_rules.properties
>>>
>>> ... but it only works with /MyApplication/ (the name in webapps in
>>> tomcat).
>>> Any other form (myapplication, MYAPPLICATION or MYAP) returns a 404 error.
>>>
>>> Hi.
>> It might be a good idea to provide a bit of detail about your
>> configuration, it would help the people trying to help you.
>> One can kind of guess from the above that you are running under Windows,
>> with Tomcat 6.0.14, and are using an isapi connector, thus from IIS or the
>> like, but it requires some effort.
>>
>> I don't really know that precise environment, but I'll take a pot-shot
>> anyway : is it not that your rewrite rules are being run too late, and they
>> never see requests with /myapplication/, /MYAPPLICATION/ or /MYAP/ ?
>> Presumably, before they get to the isapi connector, requests go to the
>> front-end HTTPD server. If that one does not know that it should redirect
>> /myapplication/, /MYAPPLICATION/ or /MYAP/ to the connector, then the
>> connector never gets to see them.
>> Instead, the HTTPD server will try to serve those requests itself, and
>> since it doesn't have those documents, respond with 404.
>> Does the 404 error page look like a Tomcat page, or else ?
>>
>> André
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
Re: Tomcat, iis connector and case sensitivity
Posted by Luis Villa <lv...@gmail.com>.
Hello André, thanks for your answer,
My configuration is:
- tomcat 6
- IIS 6
- Windows 2003 server SP1
- tomcat connector 1.2.26
When I ask for MYAP, it doesn't appear a IIS screen, but a Tomcat error. So,
I assumed the connector was correctly deriving the requests from IIS to
Tomcat.
2008/6/16 André Warnier <aw...@ice-sa.com>:
>
>
> Luis Villa wrote:
>
>> Hello all,
>>
>> I'm trying to add redirect rules to the tomcat connector. I've been
>> reading
>> Tomcat connector documentation, and what I've done till the moment is
>> this:
>>
>> 1.- I've created a rewrite_rules.properties with this content:
>>
>> /myapplication/=/MyApplication/
>> /MYAPPLICATION/=/MyApplication/
>> /MYAP/=/MyApplication/
>>
>> 2.- I've added this to isapi_redirect.properties:
>>
>> # Full path to the rewrite_rules.properties file
>>
>> rewrite_rule_file=c:\apache-tomcat-6.0.14\conf\rewrite_rules.properties
>>
>> ... but it only works with /MyApplication/ (the name in webapps in
>> tomcat).
>> Any other form (myapplication, MYAPPLICATION or MYAP) returns a 404 error.
>>
>> Hi.
> It might be a good idea to provide a bit of detail about your
> configuration, it would help the people trying to help you.
> One can kind of guess from the above that you are running under Windows,
> with Tomcat 6.0.14, and are using an isapi connector, thus from IIS or the
> like, but it requires some effort.
>
> I don't really know that precise environment, but I'll take a pot-shot
> anyway : is it not that your rewrite rules are being run too late, and they
> never see requests with /myapplication/, /MYAPPLICATION/ or /MYAP/ ?
> Presumably, before they get to the isapi connector, requests go to the
> front-end HTTPD server. If that one does not know that it should redirect
> /myapplication/, /MYAPPLICATION/ or /MYAP/ to the connector, then the
> connector never gets to see them.
> Instead, the HTTPD server will try to serve those requests itself, and
> since it doesn't have those documents, respond with 404.
> Does the 404 error page look like a Tomcat page, or else ?
>
> André
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
Re: Tomcat, iis connector and case sensitivity
Posted by André Warnier <aw...@ice-sa.com>.
Luis Villa wrote:
> Hello all,
>
> I'm trying to add redirect rules to the tomcat connector. I've been reading
> Tomcat connector documentation, and what I've done till the moment is this:
>
> 1.- I've created a rewrite_rules.properties with this content:
>
> /myapplication/=/MyApplication/
> /MYAPPLICATION/=/MyApplication/
> /MYAP/=/MyApplication/
>
> 2.- I've added this to isapi_redirect.properties:
>
> # Full path to the rewrite_rules.properties file
>
> rewrite_rule_file=c:\apache-tomcat-6.0.14\conf\rewrite_rules.properties
>
> ... but it only works with /MyApplication/ (the name in webapps in tomcat).
> Any other form (myapplication, MYAPPLICATION or MYAP) returns a 404 error.
>
Hi.
It might be a good idea to provide a bit of detail about your
configuration, it would help the people trying to help you.
One can kind of guess from the above that you are running under Windows,
with Tomcat 6.0.14, and are using an isapi connector, thus from IIS or
the like, but it requires some effort.
I don't really know that precise environment, but I'll take a pot-shot
anyway : is it not that your rewrite rules are being run too late, and
they never see requests with /myapplication/, /MYAPPLICATION/ or /MYAP/ ?
Presumably, before they get to the isapi connector, requests go to the
front-end HTTPD server. If that one does not know that it should
redirect /myapplication/, /MYAPPLICATION/ or /MYAP/ to the connector,
then the connector never gets to see them.
Instead, the HTTPD server will try to serve those requests itself, and
since it doesn't have those documents, respond with 404.
Does the 404 error page look like a Tomcat page, or else ?
André
---------------------------------------------------------------------
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
Re: Tomcat, iis connector and case sensitivity
Posted by Luis Villa <lv...@gmail.com>.
Thank you very much for cheating, then :)
2008/6/16 André Warnier <aw...@ice-sa.com>:
>
>
> Rainer Jung wrote:
>
>> Luis Villa wrote:
>>
>>> I catched it when, setting log_level to debug did nothing.
>>>
>>
>> That was a desired side effect of the exercise :)
>>
>
> You see, cheating will get you nowhere !
> :-)
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
Re: Tomcat, iis connector and case sensitivity
Posted by André Warnier <aw...@ice-sa.com>.
Rainer Jung wrote:
> Luis Villa wrote:
>> I catched it when, setting log_level to debug did nothing.
>
> That was a desired side effect of the exercise :)
You see, cheating will get you nowhere !
:-)
---------------------------------------------------------------------
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
Re: Tomcat, iis connector and case sensitivity
Posted by Rainer Jung <ra...@kippdata.de>.
Luis Villa wrote:
> I catched it when, setting log_level to debug did nothing.
That was a desired side effect of the exercise :)
---------------------------------------------------------------------
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
Re: Tomcat, iis connector and case sensitivity
Posted by Luis Villa <lv...@gmail.com>.
Ok, I found the problem :)
What was misconfigured was the virtual directory in IIS. There was a mess of
configuration files and the one I was changing was not the one the previous
system admin configured :S
The thing is, there was configuration in the registry, and 3 folders with
the isapi redirector. I catched it when, setting log_level to debug did
nothing.
Now it works perfectly.
Thank you all :)
Regards
Re: Tomcat, iis connector and case sensitivity
Posted by Rainer Jung <ra...@kippdata.de>.
André Warnier wrote:
>> Set you redirector log level to debug and try once.
>>
> Woa ! That's cheating !
> :-)
It depends on the rules of the game ;)
---------------------------------------------------------------------
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
Re: Tomcat, iis connector and case sensitivity
Posted by André Warnier <aw...@ice-sa.com>.
Rainer Jung wrote:
> Luis Villa wrote:
[...]
> Set you redirector log level to debug and try once.
>
Woa ! That's cheating !
:-)
---------------------------------------------------------------------
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
Re: Tomcat, iis connector and case sensitivity
Posted by Rainer Jung <ra...@kippdata.de>.
Luis Villa wrote:
> Hello all,
>
> I'm trying to add redirect rules to the tomcat connector. I've been reading
> Tomcat connector documentation, and what I've done till the moment is this:
>
> 1.- I've created a rewrite_rules.properties with this content:
>
> /myapplication/=/MyApplication/
> /MYAPPLICATION/=/MyApplication/
> /MYAP/=/MyApplication/
>
> 2.- I've added this to isapi_redirect.properties:
>
> # Full path to the rewrite_rules.properties file
>
> rewrite_rule_file=c:\apache-tomcat-6.0.14\conf\rewrite_rules.properties
>
> ... but it only works with /MyApplication/ (the name in webapps in tomcat).
> Any other form (myapplication, MYAPPLICATION or MYAP) returns a 404 error.
>
> Does somebody what I'm doing wrong?
Set you redirector log level to debug and try once.
During startup, you should see
Using rewrite rule file YOURRULESFILE
in the log file, and later
Loaded rewrite rule file YOURRULESFILE
Between those two, you should also see lines indicating, that the
contents of the file got parsed.
If a rule matches a request, you should also see a log line in the
redirector log file of the form:
rewriten URI [OLDURL]->[NEWURL]
(the typo "rewriten" instead of "rewritten" has only been corrected in
the latest release 1.2.26, before it is written as above).
Regards,
Rainer
---------------------------------------------------------------------
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
Re: Tomcat, iis connector and case sensitivity
Posted by Luis Villa <lv...@gmail.com>.
Hello all,
I'm trying to add redirect rules to the tomcat connector. I've been reading
Tomcat connector documentation, and what I've done till the moment is this:
1.- I've created a rewrite_rules.properties with this content:
/myapplication/=/MyApplication/
/MYAPPLICATION/=/MyApplication/
/MYAP/=/MyApplication/
2.- I've added this to isapi_redirect.properties:
# Full path to the rewrite_rules.properties file
rewrite_rule_file=c:\apache-tomcat-6.0.14\conf\rewrite_rules.properties
... but it only works with /MyApplication/ (the name in webapps in tomcat).
Any other form (myapplication, MYAPPLICATION or MYAP) returns a 404 error.
Does somebody what I'm doing wrong?
Thank you all
Regards