You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Asha K S <as...@adobe.com> on 2011/04/28 08:42:18 UTC

External Docroot support for Tomcat

HI,

We have a requirement of supporting two docroots i.e one of tomcat (webapps folder) and also webservers webroot (Apache webservers htdocs folder) for same context.
We found that there is no way to actually do it,we have made some changes to Tomcat 7.0.8 source code and Connectors source code so that when Tomcat resolves getRealPath it actually asks connector for the RealPath(since the files are present in webservers webroot) .For this we have added an extra command like GET_BODY_CHUNK when sent connector will ask the webserver for the realpath and sends it to Tomcat server.

We would like to make this contribution to Tomcat source code ,please let me know what steps do I need to follow to submit the code and if I have to get it reviewed by someone before doing this.

Thanks,
Asha

Re: External Docroot support for Tomcat

Posted by Pid <pi...@pidster.com>.
On 5/2/11 12:59 PM, Asha K S wrote:
> HI,
> 
> Thanks a lot for helping me on this.Our basic requirement is having two docroots for same context '/' .But I have read that using '/' as an aliasPath is not allowed. Thats the reason we had to change the code. Please let me know if there is any way to do that.

It's a not uncommon requirement to support overlapping sources for HTTPD
and Tomcat, usually resolved by some cunning mod_rewrite statements,
rather than modifying Tomcat's code.

What is the actual problem and why isn't it possible to handle this in
HTTPD, by selectively forwarding to Tomcat?


p


> Thanks,
> Asha
> 
> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
> Sent: Friday, April 29, 2011 2:58 AM
> To: Tomcat Developers List
> Subject: Re: External Docroot support for Tomcat
> 
> 2011/4/28 Asha K S <as...@adobe.com>:
>> HI,
>>
>> We have a requirement of supporting two docroots i.e one of tomcat (webapps folder) and also webservers webroot (Apache webservers htdocs folder) for same context.
>> We found that there is no way to actually do it,
> 
> Isn't "aliases" attribute on Context what is needed for you? [1]
> 
> It is also possible map nested paths as separate web applications, by
> naming them as foo#bar - see Naming in [1].
> 
> [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
> 
>> we have made some changes to Tomcat 7.0.8 source code and Connectors source code so that when Tomcat resolves getRealPath it actually asks connector for the RealPath(since the files are present in webservers webroot) .For this we have added an extra command like GET_BODY_CHUNK when sent connector will ask the webserver for the realpath and sends it to Tomcat server.
>>
>> We would like to make this contribution to Tomcat source code ,please let me know what steps do I need to follow to submit the code and if I have to get it reviewed by someone before doing this.
> 
> Create an enhancement request in Bugzilla
> http://tomcat.apache.org/bugreport.html#Patches_and_enhancement_requests
> 
> Best regards,
> Konstantin Kolinko
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 



RE: External Docroot support for Tomcat

Posted by Asha K S <as...@adobe.com>.
HI,

Thanks a lot for helping me on this.Our basic requirement is having two docroots for same context '/' .But I have read that using '/' as an aliasPath is not allowed. Thats the reason we had to change the code. Please let me know if there is any way to do that.

Thanks,
Asha

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Friday, April 29, 2011 2:58 AM
To: Tomcat Developers List
Subject: Re: External Docroot support for Tomcat

2011/4/28 Asha K S <as...@adobe.com>:
> HI,
>
> We have a requirement of supporting two docroots i.e one of tomcat (webapps folder) and also webservers webroot (Apache webservers htdocs folder) for same context.
> We found that there is no way to actually do it,

Isn't "aliases" attribute on Context what is needed for you? [1]

It is also possible map nested paths as separate web applications, by
naming them as foo#bar - see Naming in [1].

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

> we have made some changes to Tomcat 7.0.8 source code and Connectors source code so that when Tomcat resolves getRealPath it actually asks connector for the RealPath(since the files are present in webservers webroot) .For this we have added an extra command like GET_BODY_CHUNK when sent connector will ask the webserver for the realpath and sends it to Tomcat server.
>
> We would like to make this contribution to Tomcat source code ,please let me know what steps do I need to follow to submit the code and if I have to get it reviewed by someone before doing this.

Create an enhancement request in Bugzilla
http://tomcat.apache.org/bugreport.html#Patches_and_enhancement_requests

Best regards,
Konstantin Kolinko

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


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


Re: External Docroot support for Tomcat

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/4/28 Asha K S <as...@adobe.com>:
> HI,
>
> We have a requirement of supporting two docroots i.e one of tomcat (webapps folder) and also webservers webroot (Apache webservers htdocs folder) for same context.
> We found that there is no way to actually do it,

Isn't "aliases" attribute on Context what is needed for you? [1]

It is also possible map nested paths as separate web applications, by
naming them as foo#bar - see Naming in [1].

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

> we have made some changes to Tomcat 7.0.8 source code and Connectors source code so that when Tomcat resolves getRealPath it actually asks connector for the RealPath(since the files are present in webservers webroot) .For this we have added an extra command like GET_BODY_CHUNK when sent connector will ask the webserver for the realpath and sends it to Tomcat server.
>
> We would like to make this contribution to Tomcat source code ,please let me know what steps do I need to follow to submit the code and if I have to get it reviewed by someone before doing this.

Create an enhancement request in Bugzilla
http://tomcat.apache.org/bugreport.html#Patches_and_enhancement_requests

Best regards,
Konstantin Kolinko

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