Change Tomcat Settings in Amazon ElasticBeanstalk

Question:

I'm having difficulties assigning JDBCHealm properties to tomcat server. How to add new properties to server.xml file or tomcat-users.xml file when app is on amazon server hosted with tomcat server as elasticbeanstalk?

Answer:

You can override the settings as follows:

Create a directory inside your webapp , and paste your server.xml . After that, create an xml: server-update.config , with the code below:

container_commands: 
  replace-config: 
    command: cp .ebextensions/server.xml /etc/tomcat7/server.xml

This information can be found at:
https://aws.amazon.com/en/blogs/aws/customize-elastic-beanstalk-using-configuration-files/

Note that as above, your server.xml will completely replace the existing one, if you just want to replace some settings or insert others, see the soEN form below:
https://stackoverflow.com/a/30598373/1997073

Scroll to Top