-
Notifications
You must be signed in to change notification settings - Fork 0
YT04‐Configure database environment variable in Tomcat
Zhamri Che Ani edited this page Apr 10, 2026
·
1 revision
sudo apt update
sudo apt install postgresql-client-common
ps aux | grep tomcat
-Dcatalina.base=/var/lib/tomcat10
-Dcatalina.home=/usr/share/tomcat10
| Type | Path |
|---|---|
| CATALINA_BASE (runtime config) | /var/lib/tomcat10 |
| CATALINA_HOME (installation) | /usr/share/tomcat10 |
vim /etc/default/tomcat10
If you use System.getProperty(...)
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -DAPP_DB_URL=jdbc:postgresql://aws-1-ap-southeast-1.pooler...
Choose
Transaction Poolerhost to ensure the server uses a reachable IPv4 endpoint. Otherwise, you will get "Network is unreachable"
systemctl restart tomcat10
systemctl status tomcat10