For Securing my Apache Tomcat server on Ubuntu Server 18.04 LTS,

I wanted to set attribute deployXML = false, but I don't know in which xml file. In the tomcat folder, I have the files server.xml / context.xml / web.xml and tomcat-user.xml and a named folder Catalina with an empty localhost folder. In the Tomcat documentation, they describe the host attributes but I can't see where I should place my config.


The attribute is set in the <Host> container element of your server.xml.

Here is an snippet of the default server.xml with the added attribute:

<Host name="localhost" appBase="webapps"
    deployXML="false" unpackWARs="true" autoDeploy="true">

If the attribute is disabled, you will have to provide the (now disabled) /META-INF/context.xml of your webapp in the location defined by the xmlBase attribute.

On Debian, I had to to copy

cp /var/lib/tomcat8/webapps/ROOT/META-INF/context.xml /etc/tomcat8/Catalina/localhost/ROOT.xml

for the root webapp, otherwise the application won't start.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.