-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Terence,
On 7/20/17 6:14 AM, Mark Thomas wrote: > On 19/07/17 22:28, Terence Lee wrote: >> Please forgive any misuse of terminology here. I am a sysadmin >> involved in devops deployments of tomcat servers and >> applications, but I don't really know much about how tomcat >> actually works. I am a unix guy! >> >> We recently had a deployment of a third party application that >> resulted in tomcat throwing 404 errors on any content of a >> symlinked directory that was contained in/under an aliased path. >> It seems to me that it is something in the app configuration gone >> awry, but the vendor claims not. So I am casting about for some >> information here after not coming up with anything definitive in >> the docs or by act of google. >> >> Example: >> >> 1) The context.xml for the root context has the following: >> >> aliases="/static=/pnas/legacy/static" >> >> 2) /pnas/legacy/static/ has a symlinked directory that functions >> as expected at the o/s level: >> >> [root@exampleserver]# ls -lad /pnas/legacy/static/Digital >> lrwxrwxrwx. 1 appsrv apps 34 Jul 17 21:40 >> /pnas/legacy/static/Digital -> /pnas/editorial/Digital/ >> >> 3) tomcat runs as the appsrv user and all files in >> /pnas/editorial/Digital/ are owned by appsrv:apps, so we would >> expect <webroot>/static/Digital/* to be accessible without error >> >> 4) attempts to access files in <webroot>/static/Digital result in >> a 404 error ... but this was not the case before this last app >> deploy >> >> 5) reverting the build of the app is not possible as it was one >> part of a really big multiheaded deployment. We can work around >> the issue but accrue signifcant technical debt as a result. >> >> 6) Versions of anything relevant other than the app itself have >> not changed: tomcat = 7.0.56 java = 1.7.0_71 o/s = Red Hat >> Enterprise Linux Server release 6.8 (Santiago) >> 2.6.32-642.11.1.el6.x86_64 >> >> Question: >> >> Does the use of symlinks under aliases require some like an >> "allowLinking" attribute or something else that could have >> misconfigured in the app? > > Yes. allowLinking applies to aliases as well as the Context's > docBase. Another option would be to use Tomcat's "aliases" configuration to effect the symlink. So instead of aliases="/static=/pnas/legacy/static" you could do aliases="/static/Digital=/pnas/editorial/Digital,/static=/pnas/legacy/st atic". It's probably better to simply "allowLinking", though. Odd that this did not affect earlier versions of their application. Do they supply their own context.xml file which (a) had and (b) no longer includes the allowLinking="true" setting? >> The docs don't really address this case and I can only find >> reference to "allowLinking" affecting material symlinked >> directlly in or under the web context root. Aliases appear to >> be suggested as an alternative and symlinks under an alias are >> not specifically addressed (that I have seen). >> >> Any thoughts are appreciated and please do pardon any tomcat >> vocabulary that I may have injured in this effort to pose a >> question. > > No problem. The question was clearly stated and easily understood. Agreed. You included (a) your Tomcat version (b) a clear description of the problem (and accompanying configuration) and (c) what you expected to happen. If only all first-time posters had such high-quality posts :) - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJZcMJBAAoJEBzwKT+lPKRY6KoP/jhFmAw/Y7CuCoMNv2lswJXj sg/ialC1/b4t5EIcZXayrPHnEw60b9JBEKM+h5mkvYDSQATvTKIxeBqRkP1yI5w4 w7g0Ft4G5vbK++ihquahfRiWm++nAh284YK8V3TNFhr54LmfjlIwjwFAXsmkerW7 P6WQ0lWwziNrSiw6ynf2/yXn8kzPxQ9IdgIaFweKqEyHpUVxRUskYgJeSkm0v8lq pzweiVT5eiRtJSSpevf1WycltPY3nROTlyuDSHEoVeoNnWmfUiHnsMusw7SSVwyt STG363IN9m611yEsujiP1+KOpkgrF1DFaay5mdn7eNAOPIqnkmKQF6d8IfTZHmeK u1Oqr6pgu8Qp+XHhp4ni3o3tidLEIW/HWMZPzhYN3rpMzHh5ndNGiMP9hN8yZxDC eZpbY66fiOtjBzghE34KDae+e/QqJdYiRL8E3iD8Mh1GCYrc5T4N/IapPP0PloRT RoEoK98n7pei6EwK/DsTfHihnmcc0xQTyIVcyxdLmLZ5Omyh0UMbzFZtKMqVV6vA UUKzOW3mZ/amCxQmW7hc4A+0H3BMTtmrxGB9dqpVKrvkp/E4nynQNwVsRavjOXpk uMe8j2AzUTaxvoj+B98GhNjr5/tXwT/3MYlELtprxZKodnoTtIQ/VMCse69BUYhn l128qZo/lD5zZ2RbLr5h =bOWF -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org