I have DHIS2 2.22 running on ubuntu server 14.04. I have:
- setup a the tomcat file with the contents:
#Tomcat init script
case $1 in
- executed the commands
sudo chmod +x /etc/init.d/tomcat
sudo /usr/sbin/update-rc.d -f tomcat defaults 81
update-rc.d: warning: /etc/init.d/tomcat missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/tomcat …
/etc/rc0.d/K81tomcat -> …/init.d/tomcat
/etc/rc1.d/K81tomcat -> …/init.d/tomcat
/etc/rc6.d/K81tomcat -> …/init.d/tomcat
/etc/rc2.d/S81tomcat -> …/init.d/tomcat
/etc/rc3.d/S81tomcat -> …/init.d/tomcat
/etc/rc4.d/S81tomcat -> …/init.d/tomcat
/etc/rc5.d/S81tomcat -> …/init.d/tomcat
*I wonder if there’s a problem on the warnings.
On Server REBOOT. Tomcat starts but I get a 404 error until I shutdown and restart Tomcat. I noticed that the **HOME **variable in the /etc/init.d/tomcat file was not pointing to my tomcat- instance.
So I changed the line **HOME=/home/dhis/tomcat/bin **to **HOME=/home/dhis/tomcat-/bin. **In my case HOME=/home/dhis/tomcat-dhis/bin.
At this point I still got the 404.
Checking the /etc/init.d/ directory showed two tomcat files, another called tomcat7. Assuming this file could be starting at startup without reference to my tomcat-dhis, i renamed it to tomcat7_bu. Run > sudo reboot and it worked.
Please recommend if there’s a better solution. Also, is there a better way of presenting solutions to problems like on stackexchange.com?
I hope this helps someone else in my situation.