My Lucee server is crashing because I haven't quite figured out how to configure it properly. As a temporary solution I have written a bash script to run as a cron job every 5 minutes. This should check if TC is running and accessible and restart Lucee/TC if not. I would appreciate constructive comments or improvements. I have the website running on port 80 on Tomcat (no Apache). This is running as a system cron.
#!/bin/bash
if sudo netstat -tulpen | grep ":80 " > /dev/null 2>&1 && ps -ef | grep tomcat | grep java > /dev/null 2>&1
then
echo "Tomcat Running" > /dev/null
else
echo "Tomcat Stopped" > /dev/null
sudo /opt/lucee/lucee_ctl restart
fi