You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Erez Efrati <er...@netmedia.net.il> on 2003/08/19 10:20:37 UTC

directory outside context root

Is there some way to tell tomcat to serve files from a 
specific directory outside the context root?

Thanks in advance,
Erez



Re: directory outside context root

Posted by John Turner <to...@johnturner.com>.
I couldn't really say.  I force my developers to keep everything in 
their Contexts, so the issue doesn't come up for me.

John

Erez Efrati wrote:

> Well I did find a way to do that by declaring another context just for
> that with docBase='c:\www\files' for example. Thing is, all this is not
> really working under the Tomcat bundled in JBoss.
> 
> One option of solving this is having a servlet (Struts Action for
> example) which will serve the files. 
> 
> The other way is using the 'alias' directive under Apache directing to
> wherever I'd like in the file system. For that I need to put Apache in
> front of JBoss/Tomcat. 
> 
> Which is better?
> 
> Thanks,
> Erez
> 
> 
> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com] 
> Sent: Tuesday, August 19, 2003 1:57 PM
> To: Tomcat Users List
> Subject: Re: directory outside context root
> 
> 
> If on UNIX or Linux, you could use symbolic links, but this is not 
> recommended for security and portability reasons.
> 
> So, in general, the answer is "no".
> 
> John
> 
> Erez Efrati wrote:
> 
> 
>>Is there some way to tell tomcat to serve files from a 
>>specific directory outside the context root?
>>
>>Thanks in advance,
>>Erez
>>
>>
>>
>>---------------------------------------------------------------------
>>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
> 
> 
> 
> ---------------------------------------------------------------------
> 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: directory outside context root

Posted by John Turner <to...@johnturner.com>.
I couldn't really say.  I force my developers to keep everything in 
their Contexts, so the issue doesn't come up for me.

John

Erez Efrati wrote:

> Well I did find a way to do that by declaring another context just for
> that with docBase='c:\www\files' for example. Thing is, all this is not
> really working under the Tomcat bundled in JBoss.
> 
> One option of solving this is having a servlet (Struts Action for
> example) which will serve the files. 
> 
> The other way is using the 'alias' directive under Apache directing to
> wherever I'd like in the file system. For that I need to put Apache in
> front of JBoss/Tomcat. 
> 
> Which is better?
> 
> Thanks,
> Erez
> 
> 
> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com] 
> Sent: Tuesday, August 19, 2003 1:57 PM
> To: Tomcat Users List
> Subject: Re: directory outside context root
> 
> 
> If on UNIX or Linux, you could use symbolic links, but this is not 
> recommended for security and portability reasons.
> 
> So, in general, the answer is "no".
> 
> John
> 
> Erez Efrati wrote:
> 
> 
>>Is there some way to tell tomcat to serve files from a 
>>specific directory outside the context root?
>>
>>Thanks in advance,
>>Erez
>>
>>
>>
>>---------------------------------------------------------------------
>>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
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



RE: directory outside context root

Posted by Stuart Stephen <st...@talkics.com>.
I personally would use the Apache alias. The codes already written for you
and through apache the serving of the files should be pretty fast. You don't
need to write any servlets or anything then to allow access to these files.

It all depends on your project spec. If these files should have restricted
access then that adds more to the equation.

-----Original Message-----
From: Erez Efrati [mailto:ereze@netmedia.net.il]
Sent: 19 August 2003 17:49
To: 'Tomcat Users List'
Subject: RE: directory outside context root


Well I did find a way to do that by declaring another context just for
that with docBase='c:\www\files' for example. Thing is, all this is not
really working under the Tomcat bundled in JBoss.

One option of solving this is having a servlet (Struts Action for
example) which will serve the files.

The other way is using the 'alias' directive under Apache directing to
wherever I'd like in the file system. For that I need to put Apache in
front of JBoss/Tomcat.

Which is better?

Thanks,
Erez


-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com]
Sent: Tuesday, August 19, 2003 1:57 PM
To: Tomcat Users List
Subject: Re: directory outside context root


If on UNIX or Linux, you could use symbolic links, but this is not
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a
> specific directory outside the context root?
>
> Thanks in advance,
> Erez
>
>
>
> ---------------------------------------------------------------------
> 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



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




RE: directory outside context root

Posted by Stuart Stephen <st...@talkics.com>.
I personally would use the Apache alias. The codes already written for you
and through apache the serving of the files should be pretty fast. You don't
need to write any servlets or anything then to allow access to these files.

It all depends on your project spec. If these files should have restricted
access then that adds more to the equation.

-----Original Message-----
From: Erez Efrati [mailto:ereze@netmedia.net.il]
Sent: 19 August 2003 17:49
To: 'Tomcat Users List'
Subject: RE: directory outside context root


Well I did find a way to do that by declaring another context just for
that with docBase='c:\www\files' for example. Thing is, all this is not
really working under the Tomcat bundled in JBoss.

One option of solving this is having a servlet (Struts Action for
example) which will serve the files.

The other way is using the 'alias' directive under Apache directing to
wherever I'd like in the file system. For that I need to put Apache in
front of JBoss/Tomcat.

Which is better?

Thanks,
Erez


-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com]
Sent: Tuesday, August 19, 2003 1:57 PM
To: Tomcat Users List
Subject: Re: directory outside context root


If on UNIX or Linux, you could use symbolic links, but this is not
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a
> specific directory outside the context root?
>
> Thanks in advance,
> Erez
>
>
>
> ---------------------------------------------------------------------
> 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



---------------------------------------------------------------------
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: directory outside context root

Posted by Erez Efrati <er...@netmedia.net.il>.
Well I did find a way to do that by declaring another context just for
that with docBase='c:\www\files' for example. Thing is, all this is not
really working under the Tomcat bundled in JBoss.

One option of solving this is having a servlet (Struts Action for
example) which will serve the files. 

The other way is using the 'alias' directive under Apache directing to
wherever I'd like in the file system. For that I need to put Apache in
front of JBoss/Tomcat. 

Which is better?

Thanks,
Erez


-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com] 
Sent: Tuesday, August 19, 2003 1:57 PM
To: Tomcat Users List
Subject: Re: directory outside context root


If on UNIX or Linux, you could use symbolic links, but this is not 
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a 
> specific directory outside the context root?
> 
> Thanks in advance,
> Erez
> 
> 
> 
> ---------------------------------------------------------------------
> 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: directory outside context root

Posted by Erez Efrati <er...@netmedia.net.il>.
Well I did find a way to do that by declaring another context just for
that with docBase='c:\www\files' for example. Thing is, all this is not
really working under the Tomcat bundled in JBoss.

One option of solving this is having a servlet (Struts Action for
example) which will serve the files. 

The other way is using the 'alias' directive under Apache directing to
wherever I'd like in the file system. For that I need to put Apache in
front of JBoss/Tomcat. 

Which is better?

Thanks,
Erez


-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com] 
Sent: Tuesday, August 19, 2003 1:57 PM
To: Tomcat Users List
Subject: Re: directory outside context root


If on UNIX or Linux, you could use symbolic links, but this is not 
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a 
> specific directory outside the context root?
> 
> Thanks in advance,
> Erez
> 
> 
> 
> ---------------------------------------------------------------------
> 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



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


RE: directory outside context root

Posted by Stuart Stephen <st...@talkics.com>.
You could if your using apache and a connector.

If you use the mod_alias module in apache then you can map physical
paths/drives to certain urls.

-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com]
Sent: 19 August 2003 12:57
To: Tomcat Users List
Subject: Re: directory outside context root



If on UNIX or Linux, you could use symbolic links, but this is not
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a
> specific directory outside the context root?
>
> Thanks in advance,
> Erez
>
>
>
> ---------------------------------------------------------------------
> 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




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


RE: directory outside context root

Posted by Erez Efrati <er...@netmedia.net.il>.
Well I did find a way to do that by declaring another context just for
that with docBase='c:\www\files' for example. Thing is, all this is not
really working under the Tomcat bundled in JBoss.

I know the next question is a usual one and forgive me in advance for
asking if it is advised to put Apache in front of Tomcat? One option of
solving this is having a servlet (Struts Action for example) which will
serve the files. The other way is using the 'alias' directive under
Apache directing to wherever I'd like in the file system. Which is
better?

Erez

-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com] 
Sent: Tuesday, August 19, 2003 1:57 PM
To: Tomcat Users List
Subject: Re: directory outside context root


If on UNIX or Linux, you could use symbolic links, but this is not 
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a 
> specific directory outside the context root?
> 
> Thanks in advance,
> Erez
> 
> 
> 
> ---------------------------------------------------------------------
> 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: directory outside context root

Posted by Stuart Stephen <st...@talkics.com>.
You could if your using apache and a connector.

If you use the mod_alias module in apache then you can map physical
paths/drives to certain urls.

-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com]
Sent: 19 August 2003 12:57
To: Tomcat Users List
Subject: Re: directory outside context root



If on UNIX or Linux, you could use symbolic links, but this is not
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a
> specific directory outside the context root?
>
> Thanks in advance,
> Erez
>
>
>
> ---------------------------------------------------------------------
> 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: directory outside context root

Posted by Erez Efrati <er...@netmedia.net.il>.
Well I did find a way to do that by declaring another context just for
that with docBase='c:\www\files' for example. Thing is, all this is not
really working under the Tomcat bundled in JBoss.

I know the next question is a usual one and forgive me in advance for
asking if it is advised to put Apache in front of Tomcat? One option of
solving this is having a servlet (Struts Action for example) which will
serve the files. The other way is using the 'alias' directive under
Apache directing to wherever I'd like in the file system. Which is
better?

Erez

-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com] 
Sent: Tuesday, August 19, 2003 1:57 PM
To: Tomcat Users List
Subject: Re: directory outside context root


If on UNIX or Linux, you could use symbolic links, but this is not 
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a 
> specific directory outside the context root?
> 
> Thanks in advance,
> Erez
> 
> 
> 
> ---------------------------------------------------------------------
> 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



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


Re: directory outside context root

Posted by John Turner <to...@johnturner.com>.
If on UNIX or Linux, you could use symbolic links, but this is not 
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a 
> specific directory outside the context root?
> 
> Thanks in advance,
> Erez
> 
> 
> 
> ---------------------------------------------------------------------
> 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: directory outside context root

Posted by John Turner <to...@johnturner.com>.
If on UNIX or Linux, you could use symbolic links, but this is not 
recommended for security and portability reasons.

So, in general, the answer is "no".

John

Erez Efrati wrote:

> Is there some way to tell tomcat to serve files from a 
> specific directory outside the context root?
> 
> Thanks in advance,
> Erez
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>