Amazon Linux 2 Tomcat Setup
Setting up an Amazon Linux 2 server for PilotFish can be tricky without prior knowledge.
Below are some general steps to get a Tomcat set up to host PilotFish war files.
Install OpenJDK 11:
- sudo amazon-linux-extras install java-openjdk11
Installing and Running Tomcat 8.5:
- sudo amazon-linux-extras install tomcat8.5
- sudo systemctl start|stop|restart tomcat
- webapps dir /var/lib/tomcat/webapps/
- drop your PilotFish war files here
Set Environment Settings:
- /usr/lib/systemd/system/tomcat.service
- Adding {Environment=”CATALINA_OPTS=-Xms512M -Xmx1024M”} without the brackets will allow you to set normal java params for memory and etc.
- Additionally, you can add custom variables as System Environment Variables in this manner. This is usually done if credentials are to be stored outside of the EIP Interfaces.
- Edits to this will likely require a “sudo systemctl daemon-reload” to be run
General Troubleshooting:
- If you see “Failed to execute operation: The name org.freedesktop.PolicyKit1 was not provided by any .service files”, you probably didn’t run the command with sudo.