I’m trying to start up Apache Tomcat on a Google cloud server. It’s a CentOS 7 server and has Apache Tomcat 8 on it. Instructions are https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7 but when I get to:
sudo systemctl start tomcat
I get the message:
Job for tomcat.service failed because the control process exited with error code. See "systemctl status tomcat.service" and "journalctl -xe" for details.
For systemctl status tomcat.service I get:
tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/etc/systemd/system/tomcat.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2017-12-29 17:04:47 UTC; 639ms ago
Process: 3526 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=203/EXEC)
Dec 29 17:04:47 jira-dev systemd[1]: Unit tomcat.service entered failed state.
Dec 29 17:04:47 jira-dev systemd[1]: tomcat.service failed.
For journalctl -xe I can't post all of it because it "looks like spam" but I get:
-- The error number returned by this process is 13.
Dec 29 16:55:33 jira-dev systemd[1]: tomcat.service: control process exited, code=exited status=203
Dec 29 16:55:33 jira-dev systemd[1]: Failed to start Apache Tomcat Web Application Container.
-- Subject: Unit tomcat.service has failed
-- Defined-By: systemd
and
-- The result is failed.
Dec 29 16:55:33 jira-dev systemd[1]: Unit tomcat.service entered failed state.
Dec 29 16:55:33 jira-dev systemd[1]: tomcat.service failed.
Dec 29 16:55:44 jira-dev systemd[1]: tomcat.service holdoff time over, scheduling restart.
Dec 29 16:55:44 jira-dev systemd[1]: Starting Apache Tomcat Web Application Container...
-- Subject: Unit tomcat.service has begun start-up
-- Defined-By: systemd
and
-- Unit tomcat.service has begun starting up. Dec 29 16:55:44 jira-dev systemd[3317]: Failed at step EXEC spawning /opt/tomcat/bin/startup.sh: Permission denied
-- Subject: Process /opttomcat/bin/startup.sh could not be executed
-- Defined-By: systemd/
and
-- The error number returned by this process is 13.
Dec 29 16:55:44 jira-dev systemd[1]: tomcat.service: control process exited, code=exited status=203
Dec 29 16:55:44 jira-dev systemd[1]: Failed to start Apache Tomcat Web Application Container.
-- Subject: Unit tomcat.service has failed
-- Defined-By: systemd
The /etc/system/system/tomcat.service file looks like the one from the instructions.
I have also set JAVA_HOME, just in case.
I see the permission error, but I have given the tomcat user ownership of the tomcat directory as per CentOs 7.1 - Install Tomcat 8 with the command cd /opt && sudo chown -R tomcat tomcat/
I have also tried commenting out the Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC' line from the tomcat.service file, although it didn't help, so I un-commented it.
I'm running as root.