无法远程启动Apache Tomcat服务器(linux)
我尝试了以下方法,但收效甚微:无法远程启动Apache Tomcat服务器(linux),tomcat,ssh,remote-server,Tomcat,Ssh,Remote Server,我尝试了以下方法,但收效甚微: 远程运行catalina.sh start命令 $ssh-t服务器名sudo-H-u myuser sh/catalina/home/path/bin/catalina.sh start 使用CATALINA_BASE:/CATALINA/home/path 使用CATALINA\u HOME:/CATALINA/HOME/path 使用CATALINA_TMPDIR:/CATALINA/home/path/temp 使用JRE_HOME:/usr/lib/jv
$ssh-t服务器名sudo-H-u myuser sh/catalina/home/path/bin/catalina.sh start
使用CATALINA_BASE:/CATALINA/home/path
使用CATALINA\u HOME:/CATALINA/HOME/path
使用CATALINA_TMPDIR:/CATALINA/home/path/temp
使用JRE_HOME:/usr/lib/jvm/java-1.8.0-openjdk-amd64
使用类路径:/catalina/home/path/。/extraclasspathfiles:/catalina/home/path/bin/bootstrap.jar:/catalina/home/path/bin/tomcat-juli.jar
Tomcat开始了。
$ssh-t服务器名称“ps ax | grep java”
24322 pts/0 S+0:00 grep--color=auto-java
不走运
$ ssh -t server-name sudo -H -u myuser sh /catalina/home/path/bin/remote.sh/bin/remote.sh
Using CATALINA_BASE: Using CATALINA_BASE: /catalina/home/path
Using CATALINA_HOME: Using CATALINA_HOME: /catalina/home/path
Using CATALINA_TMPDIR: Using CATALINA_TMPDIR: /catalina/home/path/temp/temp
Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64
Using CLASSPATH: Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64/../extraclasspathfiles:Using CLASSPATH: /catalina/home/path/../extraclasspathfiles:/catalina/home/path/bin/bootstrap.jar:/catalina/home/path/bin/tomcat-juli.jar/bin/bootstrap.jar:Tomcat started./bin/tomcat-juli.jar
Tomcat started.
$ ssh -t server-name 'ps ax | grep java'
24322 pts/0 S+ 0:00 grep --color=auto java
再说一次,运气不好
我这里缺少什么?您正在
服务器名上启动Tomcat,并在本地执行ps
要查看Java是否在远程机器上运行,必须
ssh -t server-name 'ps ax | grep java'
我找到了答案:
ssh server-name sudo -H -u username sh /path/to/generated/bin/startup.sh
故障是由-t
引起的
-t Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine,
which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh
has no local tty.
好吧,公平,这就是我写问题的方式。我直接在远程机器上运行ps。我会解决这个问题,我希望它能这么简单!
-t Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine,
which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh
has no local tty.