Alternate location for WEB-INF folder

Does anyone know if it is possible to specify a different location for the WEB-INF folder in a Windows (IIS) install of Lucee 5 (Tomcat 8)?

For example, have the web root be c:\inetpub\wwwroot\mysite but have the WEB-INF folder reside at c:\contexts\mysite\WEB-INF.

Lucee seems to automatically create the WEB-INF folder and place it in the web site’s root folder.

Yes it is possible, if you configure the root tomcat web.xml file and specify the init param lucee-web-directory you can specify the path.

See example:

Pete Freitag
Foundeo Inc.

1 Like

Thanks Pete. That almost gets me there. However, that changes the path for all contexts on that server. I was only looking the change the path for one context.

Hi Mike - Correct that setting would apply to all site/contexts - I’m not aware of a way to do it for just one context, not to say it isn’t possible.

my question is why does it matter? is it a grumpy sysadmin?

could always try a virtual directory called web-inf and map it to other path and see if that works… #nastyworkarounds

Still would like to know why?

why is it recommended?

because keep absolutely everything which doesn’t need to be under the webroot, out of the webroot reduces the potential attack surface