1

I'm trying to configure Tomcat on my server. I have short instruction:

# /usr/local/psa/admin/sbin/tomcatmng --install-psa
# /usr/local/psa/admin/sbin/tomcatmng --is-configured
yes

it's all, but I can't do that.

When I'm in sbin, command cd tomcatmng returns

tomcatmng: Not a directory

But when I write in cmd ls I see this. What is wrong ? I'm trying also paste this in sbin:

tomcatmng --install-psa

but also error, now command not found.

What is wrong ?

ls - l in sbin

-rwxr-x--- 1 root root      70232 Mar 17  2017 tomcatmng
  • 2
    Welcome to Ask Ubuntu! Please [edit] and add the output of ls -l /usr/local/psa/admin/sbin as well as the link to the instructions you’re following and your Ubuntu version. – dessert Jun 05 '18 at 21:53
  • 3
    A command cannot be a directory. If you're asking why tomcatmng --install-psa doesn't work when you're in the /usr/local/psa/admin/sbin directory, that's because the directory is not in your PATH – steeldriver Jun 06 '18 at 00:06
  • ok, I edited this – companyn Jun 06 '18 at 08:27
  • You need full path and double check the name. And because the first examples are with root symbol #, make sure that switching to root and back you are in the same location, since it can change. – Josef Klimuk Jun 06 '18 at 13:24
  • And, right, as steeldriver wrote, you cannot execute directories. It should do be: cd . Then install tomcat: only installing commands, nobusiness with dirs. Look here to get help: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04 – Josef Klimuk Jun 06 '18 at 14:08
  • @companyn Has any of the answers helped you? Please accept it (✓) or clarify your needs using [edit]ing or comments. – Melebius Jun 14 '18 at 07:38

2 Answers2

1

tomcatmng does not seem to be a directory at all. It could not be called with parameters as the instructions suggest and the ls -l will be different for a directory. So I assume it’s more likely a command to be executed.

The # as the first character on command lines in the instructions indicates the commands shall be executed by root (opposed to $).

The same is also indicated by your ls -l output. The x in the permission column is present for the owner and group which are root and root according to the following columns. No other user is allowed to run this command.

In Ubuntu, the easiest way to run a command as root is to prepend sudo, i.e.

sudo /usr/local/psa/admin/sbin/tomcatmng --install-psa

I'm trying also paste this in sbin:

tomcatmng --install-psa

Commands in the current directory must be moreover prefixed with ./, this is a security measure.

Melebius
  • 11,431
  • 9
  • 52
  • 78
0
echo $PATH

on your PC, and you will probably find /usr/local/psa/admin/sbin/ is not in there. If the program needs to just be executed, then:

chmod 700 tomcatmng

and type:

./tomcatmng
john smith
  • 3,033
  • after ./tomcatmng I got a some commands, now I should use ./tomcatmng --install-psa ? – companyn Jun 06 '18 at 08:27
  • 1
    @companyn Exactly! You can also use the absolute path, e.g. /usr/local/psa/admin/sbin/tomcatmng --install-psa, your current directory doesn’t matter then. – dessert Jun 06 '18 at 09:15