CentOS 7.1 - Instalar o Tomcat 8

1

Estou usando este tutorial como uma referência de configuração para obter um Tomcat 8 em execução no CentOs 7.1 , mas depois de digitar:

[root@localhost tomcat]# sudo systemctl start tomcat

Eu recebo o erro:

Job for tomcat.service failed. See 'systemctl status tomcat.service' and 'journalctl -xn' for details.

systemctl status tomcat.service imprime o seguinte:

[root@localhost tomcat]# systemctl status tomcat.service
tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/etc/systemd/system/tomcat.service; disabled)
Active: failed (Result: exit-code) since Wed 2015-11-25 16:54:33 CET; 1min 19s ago
Process: 45873 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=203/EXEC)

Nov 25 16:54:33 localhost.localdomain systemd[1]: Starting Apache Tomcat Web Application Container...
Nov 25 16:54:33 localhost.localdomain systemd[1]: tomcat.service: control process exited, code=exited status=203
Nov 25 16:54:33 localhost.localdomain systemd[1]: Failed to start Apache Tomcat Web Application Container.
Nov 25 16:54:33 localhost.localdomain systemd[1]: Unit tomcat.service entered failed state.

journalctl -xn imprime o seguinte:

[root@localhost tomcat]# journalctl -xn
-- Logs begin at Wed 2015-11-25 13:50:17 CET, end at Wed 2015-11-25 16:54:33 CET. --
Nov 25 16:50:41 localhost.localdomain systemd[1]: Starting PostgreSQL database server...
-- Subject: Unit postgresql.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has begun starting up.
Nov 25 16:50:42 localhost.localdomain systemd[1]: Started PostgreSQL database server.
-- Subject: Unit postgresql.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has finished starting up.
--
-- The start-up result is done.
Nov 25 16:50:58 localhost.localdomain sshd[39118]: pam_unix(sshd:session): session closed for user demo01
Nov 25 16:50:58 localhost.localdomain systemd-logind[631]: Removed session 44.
-- Subject: A session 44 has been terminated
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A session with the ID 44 has been terminated.
Nov 25 16:54:33 localhost.localdomain sudo[45870]: root : TTY=pts/7 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/systemctl star
Nov 25 16:54:33 localhost.localdomain systemd[1]: Starting Apache Tomcat Web Application Container...
-- Subject: Unit tomcat.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat.service has begun starting up.
Nov 25 16:54:33 localhost.localdomain systemd[45873]: Failed at step EXEC spawning /opt/tomcat/bin/startup.sh: Permission denie
-- Subject: Process /opt/tomcat/bin/startup.sh could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /opt/tomcat/bin/startup.sh could not be executed and failed.
--
-- The error number returned while executing this process is 13.
Nov 25 16:54:33 localhost.localdomain systemd[1]: tomcat.service: control process exited, code=exited status=203
Nov 25 16:54:33 localhost.localdomain systemd[1]: Failed to start Apache Tomcat Web Application Container.
-- Subject: Unit tomcat.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat.service has failed.
--
-- The result is failed.
Nov 25 16:54:33 localhost.localdomain systemd[1]: Unit tomcat.service entered failed state.

O que o erro significa e como posso obter o Tomcat 8 em execução no meu servidor CentOS 7.1?

    
por kiltek 25.11.2015 / 17:00

2 respostas

4

Acabei de responder aqui que tive o mesmo problema e corrigi-lo por:

  1. dando ao usuário do tomcat a propriedade de todo o diretório tomcat :

    cd /opt && sudo chown -R tomcat tomcat/
    
  2. e comentando abaixo da linha em /etc/systemd/system/tomcat.service :

    Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
    

Espero que ajude.

    
por 08.04.2016 / 16:36
-1

No meu caso, a variável JAVA_HOME sempre auto anexa o "/ bin / java", então se eu escrever o caminho completo que eu tenho ../bin/bin/java

remover "/ bin / java" consertou a coisa para mim.

    
por 26.10.2016 / 22:58