Mac OS X上的tomcat启动脚本权限 [英] tomcat startup script permission on mac os x

查看:312
本文介绍了Mac OS X上的tomcat启动脚本权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力使用最近开始用于开发的macOS x 10.5.8.我成功安装了tomcat并为我的环境变量创建了launchd.conf.我相信它可以正常工作.因为我可以构建一个使用maven和cargo插件的netbeans项目成功,所以我找到了在线启动和停止tomcat的脚本

i'm struggling with a mac os x 10.5.8 that i've started using recently for development.i successfully installed tomcat and create launchd.conf for my environment variables.i believe it works fine.coz i can build a project with netbeans using maven and cargo plugins succesfully so i found online a script for start and stop the tomcat

#!/bin/bash

case $1 in
 start)
  sh /Library/apache-tomcat-6.0.20/bin/startup.sh
 ;; 
 stop)
  sh /Library/apache-tomcat-6.0.20/bin/shutdown.sh
 ;;
 restart)
  sh /Library/apache-tomcat-6.0.20/bin/shutdown.sh
  sh /Library/apache-tomcat-6.0.20/bin/startup.sh
 ;;
 *)
 echo "Usage :start|stop|restart"
 ;;
 esac
 exit 0

该脚本是在sudo sh中的nano中创建的 但是当我想运行它时.吐出这个

that script was created in nano in sudo sh but when i want to run it. is spit out this

sh:/usr/bin/tomcat:权限被拒绝

sh: /usr/bin/tomcat: Permission denied

我在/Library/apache-tomcat-6.0.20/bin中添加了chmod 755 * .sh和* .bat

i've added chmod 755 *.sh and *.bat inside /Library/apache-tomcat-6.0.20/bin

仍然拒绝访问,所以该怎么办?我在计算机上拥有管理员权限 感谢阅读

still access denied so what do i go around that?i have the admin privileges on the machine thanks for reading

推荐答案

您将tomcat脚本安装在哪里?我建议您将其安装到/usr/bin.安装后,请确保权限正确(即chmod 755 /usr/bin/tomcat).然后,您可以使用ls -l /usr/bin/tomcat确认.

Where did you install the tomcat script to? I'd recommend you install it to /usr/bin. Once installed, make sure the permissions are correct (i.e. chmod 755 /usr/bin/tomcat). You can then confirm with ls -l /usr/bin/tomcat.

如果/usr/bin/tomcat的权限正确后仍然出现错误,则可以在#!/bin/bash行之后添加以下两行.

If you still get errors once the permissions on /usr/bin/tomcat are correct, then you can add the following two lines following the #!/bin/bash line.

set -x
set -v

在以上几行中,bash将输出其他信息,这些信息将使您能够知道正在执行的内容以及错误的发生位置.

With the above lines, bash will output additional information that will allow you to tell what's being executed and where the error is happening.

这篇关于Mac OS X上的tomcat启动脚本权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆