-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Aryeh,

On 8/24/20 10:41, Aryeh Friedman wrote:
> On Mon, Aug 24, 2020 at 4:27 AM Mark Thomas <ma...@apache.org>
> wrote:
>
>> On 23/08/2020 22:05, Aryeh Friedman wrote:
>>> In order to allow my developers to quickly access any
>>> temporarily
>> produced
>>> html files created/stored outside of webapps (such as those
>>> created by
>> the
>>> jacoco test coverage tool) I want to allow read only access to
>>> the root directory of the development server (firewalled and
>>> all access outside of the LAN is disabled) via tomcat.   I can
>>> get it to do any directory *EXCEPT* / as the docBase but a
>>> docBase of "/" returns an empty dir
>> listing
>>> (which is obviously wrong):
>>>
>>> In config/web.xml: <servlet>
>>> <servlet-name>default</servlet-name>
>>>
>>>
>> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-c
lass>
>>>
>>
<init-param>
>>> <param-name>debug</param-name> <param-value>0</param-value>
>>> </init-param> <init-param> <param-name>listings</param-name>
>>> <param-value>true</param-value> </init-param>
>>> <load-on-startup>1</load-on-startup> </servlet>
>>
>> That should be sufficient to enable directory listings for all
>> web applications.
>>
>>> In server.xml (this works): <Host name="localhost"
>>> appBase="webapps" unpackWARs="true" autoDeploy="true">
>>>
>>> <!-- SingleSignOn valve, share authentication between web
>>> applications Documentation at: /docs/config/valve.html -->
>>> <!-- <Valve
>> className="org.apache.catalina.authenticator.SingleSignOn" />
>>> -->
>>>
>>> <!-- Access log processes all example. Documentation at:
>>> /docs/config/valve.html Note: The pattern used is equivalent to
>>> using
>> pattern="common"
>>> --> <Valve
>>> className="org.apache.catalina.valves.AccessLogValve"
>>> directory="logs" prefix="localhost_access_log" suffix=".txt"
>>> pattern="%h %l %u %t &quot;%r&quot; %s %b" /> <Context
>>> docBase="/fakeRoot" path="/files"> </Context>
>>
>> I'd do this with a ROOT.xml file in
>> $CATALINA_BASE/conf/Catalina/localhost but the above should
>> work.
>>
>>> But this does not work: <Context docBase="/" path="/files">
>>
>> The docBase is not correct (it should be "") but Tomcat probably
>> will let you get away with that.
>>
>>
> Tried and it gives me /usr/local/apache-tomcat-9.0/webapps as the
> effective dir.   This is *NOT* what I meant by the root dir I meant
> the one that is the highest point in the file system hierarchy
> (i.e. the one you get when at a shell prompt when you type "cd /")
> [this is for a Unix machine of course since Windows has no concept
> of such a directory/folder]

How are you running Tomcat? If you are using something other than
catalina.sh to launch Tomcat, is it possible you are being put into a
chroot jail?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl9D8sMACgkQHPApP6U8
pFhurw/9H/e16E2SHzSB9qavgKZvscT5tMLOvvsKR8bvobxOTRjttfnpygEXk26q
sH23n6MD4/bKDUUQv6oJoqU07Fij3GL3yX7SXvriD0Dbc5bOtS/Af2N4CcLziOy1
aqF4lddH2tAvEdJ6xBZJwZBKSQcsu0Y/Jdx/zri5ZoaVNB/vzbT6SHiFXxrckLBS
brlNT00KCAxefW7hzjXnylm+xCVQRSt6hGsh5LrjCRuRp/cVNCFYSr2lZykmj5/+
DvyBhgxFp27zBrT41kNvQDXiw8omqMuml42n6FKY0vfsgcQJ9sxcir+LUYfwVbBo
pCY2MF3dOJdaXgoWncHqHeu8XZFspLOSPU8mI5/vfYCDLcI8ZiXh22c8MsH//R8x
/KhTWttmUlD1AWiFRizi3SbEGXPq3keJS+Wi4QKVpJldIPs9zN0OlBYVri7gRrQ+
0zFBsLmsREhrSqYyCwtSTLcAGNasmb8I3jBKblmI+1ItI04PP+8p69qzaA/FcHMl
WNtyobt1Y/yKShQuWggyIPHRdU+nHntFd7p2rzhnLwbj/B9P+K3KB35Lbbye01dD
ygYDXAf14/IgHjxz7g6i3IycuJMo+KQRdogQxt3d1qSSygjLy3Y18atLtwGrcfH9
pv0itZB14d3f7HxBv/f5IdiXRhAFbPi64/0Pi0L8QaL6W1+Whho=
=uJ4Y
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to