Tomcat安装OS OS X Mavericks的问题

时间:2014-09-24 17:04:53

标签: java linux apache bash tomcat

Tomcat安装os OS X Mavericks的问题

我无法启动服务器,因为它无法启动:

/opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory

SEICCN-3:Downloads stefanieness$ /opt/apache-tomcat-8*/bin/startup.sh
Using CATALINA_BASE:   /opt/apache-tomcat-8.0.12
Using CATALINA_HOME:   /opt/apache-tomcat-8.0.12
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.12/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
Using CLASSPATH:       /opt/apache-tomcat-8.0.12/bin/bootstrap.jar:/opt/apache-tomcat-8.0.12/bin/tomcat-juli.jar
touch: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
/opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
SEICCN-3:Downloads stefanieness$ $CATALINA_HOME/bin/startup.sh
-bash: /bin/startup.sh: No such file or directory

Apache Tomcat安装:

  1. tutorialforlinux.com/2014/01/10/how-to-install-apache-tomcat-8-on-mac-10-9-mavericks-os-x-easy-visual-guide /

    SEICCN-3:assignment1 stefanieness$ sudo mkdir /opt
    Password:
    mkdir: /opt: File exists
    SEICCN-3:assignment1 stefanieness$ sudo mv /Users/stefanieness/Downloads/apache-tomcat-8* /opt/
    SEICCN-3:assignment1 stefanieness$ /opt/apache-tomcat-8*/bin/startup.sh
    Using CATALINA_BASE:   /opt/apache-tomcat-8.0.12
    Using CATALINA_HOME:   /opt/apache-tomcat-8.0.12
    Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.12/temp
    Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
    Using CLASSPATH:       /opt/apache-tomcat-8.0.12/bin/bootstrap.jar:/opt/apache-tomcat-8.0.12/bin/tomcat-juli.jar
    touch: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
    /opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
    
  2. tutorialforlinux.com/2014/01/09/how-to-install-oracle-jdk-7-on-mac-10-9-mavericks-easy-guide /

  3. 遵循教程。

    SEICCN-3:assignment1 stefanieness$ java -version
    java version "1.7.0_67"
    Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
    Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
    
    1. 错误:
    2. sudo mv /Users/stefanieness/Downloads/apache-tomcat-8* /opt/
      mv: rename /Users/stefanieness/Downloads/apache-tomcat-8.0.12 to /opt/apache-tomcat-8.0.12: Directory not empty
      
      1. 以下教程:wolfpaulus.com/jounal/mac/java-tomcat-resteasy /
      2. SEICCN-3:assignment1 stefanieness$ sudo mkdir /opt
        Password:
        mkdir: /opt: File exists
        SEICCN-3:assignment1 stefanieness$ sudo mv /Users/<myUser>/Downloads/apache-tomcat-8* /opt/
        -bash: myUser: No such file or directory
        SEICCN-3:assignment1 stefanieness$ sudo mv /Users/stefanieness/Downloads/apache-tomcat-8* /opt/
        mv: rename /Users/stefanieness/Downloads/apache-tomcat-8.0.12 to /opt/apache-tomcat-8.0.12: Directory not empty
        SEICCN-3:assignment1 stefanieness$ cd ~/Downloads/
        SEICCN-3:Downloads stefanieness$ tar -zxvf ./apache-tomcat-8.0.12.tar.gz
        tar: Error opening archive: Failed to open './apache-tomcat-8.0.12.tar.gz'
        SEICCN-3:Downloads stefanieness$ sudo mkdir -p /usr/local
        Password:
        SEICCN-3:Downloads stefanieness$ sudo mv ~/Downloads/apache-tomcat-8* /usr/local
        SEICCN-3:Downloads stefanieness$ sudo rm -f /Library/Tomcat
        SEICCN-3:Downloads stefanieness$ sudo ln -s /usr/local/apache-tomcat-8* /Library/Tomcat
        SEICCN-3:Downloads stefanieness$ sudo chown -R stefanieness/Library/Tomcat
        usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
               chown [-fhv] [-R [-H | -L | -P]] :group file ...
        SEICCN-3:Downloads stefanieness$ sudo chmod +x /Library/Tomcat/bin/*.sh
        SEICCN-3:Downloads stefanieness$ /opt/apache-tomcat-8*/bin/startup.sh
        Using CATALINA_BASE:   /opt/apache-tomcat-8.0.12
        Using CATALINA_HOME:   /opt/apache-tomcat-8.0.12
        Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.12/temp
        Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
        Using CLASSPATH:       /opt/apache-tomcat-8.0.12/bin/bootstrap.jar:/opt/apache-tomcat-8.0.12/bin/tomcat-juli.jar
        touch: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
        /opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
        SEICCN-3:Downloads stefanieness$  cd /Users/stefanieness/tomcat/bin
        -bash: cd: /Users/stefanieness/tomcat/bin: No such file or directory
        
        Other tutorials that I found:
        editrocket.com/articles/tomcat_mac.html
        Starting the server this way does not work.
        

        有人知道一个好的教程或我能做什么?

1 个答案:

答案 0 :(得分:0)

看起来你至少缺少两件事。首先,创建日志目录(-p创建路径中的每个目录,如果存在则不会抱怨):

mkdir -p /opt/apache-tomcat-8.0.12/logs

另外,对于@ wrongAnswer,您需要在启动tomcat之前在命令行上运行或者放入配置文件或rc脚本:

env CATALINA_HOME=/opt/apache-tomcat-8.0.12 /opt/apache-tomcat-8.0.12/bin/catalina.sh jpda start

希望这有帮助。