Ubuntu 18.04 の tomcat8 を ユーザ指定して実行する [Run tomcat 8 of Ubuntu 18.04 as specific user]
www として実行する。
run as www user.
sudo vi /etc/default/tomcat8
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the # default of tomcat8. TOMCAT8_USER=www # Run Tomcat as this group ID. Not setting this or leaving it blank will use # the default of tomcat8. TOMCAT8_GROUP=www
# change log dir's owner sudo chown www.adm /var/log/tomcat8 # clean up log dir sudo rm /var/log/tomcat8/*
# change conf dir's owner cd /etc/tomcat8 sudo chown -R root.www ./*
# change work dir's owner cd /var/cache sudo chown -R www.www tomcat8
# clean up tmp dir sudo rm -r /tmp/tomcat8-tomcat8-tmp
sudo vi /etc/init.d/tomcat8
TOMCAT8_USER=www TOMCAT8_GROUP=www