-bash: ./catalina.sh: No such file or directory

6,310

[site /home/public]$ cd $CATALINA_HOME/bin

You should not blindly follow recipes via copy and paste. If you haven't set the CATALINA_HOME variable this will take you to /bin, which obviously (because it is an operating system directory) is not where Tomcat is installed on FreeBSD.

If tomcat 8 is installed from packages/ports and configured for you, the location of the directory tree will be the value of the tomcat8_catalina_base setting that is in /etc/rc.conf{,.local}.

The sysrc command is one of the easiest ways of displaying it:

% sysrc tomcat8_catalina_base

Starting/stopping the pre-supplied tomcat8 service is done with the service command, moreover.

# service tomcat8 start

Further reading

Share:
6,310

Related videos on Youtube

Life after Guest
Author by

Life after Guest

Updated on September 18, 2022

Comments

  • Life after Guest
    Life after Guest almost 2 years

    Using SSH, I want to execute catalina.sh to start a Tomcat server (from my client Mac terminal).

    I log in without any issue.

    Then, I do:

    [site /home/public]$ cd $CATALINA_HOME/bin
    

    and on Enter I get:

    [site /bin]$
    

    I try:

    ./catalina.sh start
    

    but I get:

    -bash: ./catalina.sh: No such file or directory
    

    Edit. I don't know if this is important but I did the following:

    [site /usr/local]$ cd apache-tomcat-8.5
    [site /usr/local/apache-tomcat-8.5]$ cd bin
    [site /usr/local/apache-tomcat-8.5/bin]$ catalina.sh start
    -bash: catalina.sh: command not found
    [site /usr/local/apache-tomcat-8.5/bin]$ ./catalina.sh start
    Using CATALINA_BASE:   /usr/local/apache-tomcat-8.5
    Using CATALINA_HOME:   /usr/local/apache-tomcat-8.5
    Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5/temp
    Using JRE_HOME:        /usr/local
    Using CLASSPATH:       /usr/local/apache-tomcat-8.5/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5/bin/tomcat-juli.jar
    touch: /usr/local/apache-tomcat-8.5/logs/catalina.out: Read-only file system
    ./catalina.sh: cannot create /usr/local/apache-tomcat-8.5/logs/catalina.out: Read-only file system
    [site /usr/local/apache-tomcat-8.5/bin]$ 
    
    • Rui F Ribeiro
      Rui F Ribeiro over 5 years
      Please add distribution. Also have you configured tomcat? Is any app working or is it a fresh setup? Is also tomcat manually deployed or a package? Which version? Please edit the question
    • Life after Guest
      Life after Guest over 5 years
      Tomcat version is 8.5. Tomcat comes pre-configured by the hosting provider but they don't answer basic questions
    • Rui F Ribeiro
      Rui F Ribeiro over 5 years
      Which linux distro?
    • Life after Guest
      Life after Guest over 5 years
      It's not Linux, it's FreeBSD
    • Tryna Learn Somethin
      Tryna Learn Somethin over 5 years
      Check if catalina.sh exists in that folder with ls and check what permission it has
    • JdeBP
      JdeBP over 5 years
      Of course it does not exist in /bin.
    • Life after Guest
      Life after Guest over 5 years
      @TrynaLearnSomethin: ls apparently returns a list of commands, not files
    • Life after Guest
      Life after Guest over 5 years
      @JdeBP: Of course :-)
    • Life after Guest
      Life after Guest over 5 years
      @Kusalananda: honestly, I thought $CATALINA_HOME had been set from the hosting for me
    • Rui F Ribeiro
      Rui F Ribeiro over 5 years
      @Guest Your question can be on the realm of a vague question because both you and us cannot guess how the provider set up things. But some providers have nice tutorials.
    • Life after Guest
      Life after Guest over 5 years
      I agree with you
  • Life after Guest
    Life after Guest over 5 years
    I have no /etc/rc.conf (I have etc, but there's no rc.conf inside). The command returns sysrc: unknown variable 'tomcat8_catalina_base', and I suppose this is really bad news. The craziest thing of all is my final goal is simply running a JSP page
  • Life after Guest
    Life after Guest over 5 years
    I added another test