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]$ 
  • 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 – Rui F Ribeiro Mar 6 '19 at 9:15
  • Tomcat version is 8.5. Tomcat comes pre-configured by the hosting provider but they don't answer basic questions – Life after Guest Mar 6 '19 at 9:19
  • 2
    Check if catalina.sh exists in that folder with ls and check what permission it has – Tryna Learn Somethin Mar 6 '19 at 9:30
  • 1
    Of course it does not exist in /bin. – JdeBP Mar 6 '19 at 9:33
  • 1
    What do you expect $CATALINA_HOME to be (because now it's not set). Where do you set, or attempt to set, this variable? – Kusalananda Mar 6 '19 at 9:36

[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

  • 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 Mar 6 '19 at 9:56
  • I added another test – Life after Guest Mar 6 '19 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.