#!/bin/bash

erb templates/httpd.conf.tmpl >./apache/conf/httpd.conf

echo "=== APACHE ==="
/app/apache/bin/httpd -k start

echo "=== TOMCAT ==="
export CATALINA_HOME=/app/tomcat
export JRE_HOME=/app/jdk/jre
${CATALINA_HOME}/bin/startup.sh &

sleep 5
tail -f apache/logs/error_log &

while pgrep -f /app/apache/bin/httpd >/dev/null; do
	echo "Apache running..."
	sleep 60
done

exit 1

#!/bin/bash

erb templates/httpd.conf.tmpl >./apache/conf/httpd.conf

echo "=== APACHE ==="
/app/apache/bin/httpd -k start

echo "=== TOMCAT ==="
export CATALINA_HOME=/app/tomcat
export JRE_HOME=/app/jdk/jre
${CATALINA_HOME}/bin/startup.sh &

sleep 5
tail -f apache/logs/error_log &

# Deploy all war files
WEBAPPDIR=/app/tomcat/webapps
for WAR in *.war; do
	echo "Deploying $WAR"
	cp "$WAR" "$WEBAPPDIR"
done

while pgrep -f /app/apache/bin/httpd >/dev/null; do
	echo "Apache running..."
	sleep 60
done

exit 1

Deploy all provided war files automatically
Deploy all provided war files automatically
