权限被拒绝以root身份启动tomcat

我刚开始使用CentOS。

我安装Java

yum install java-1.7.0-openjdk-devel 

添加了一个用户:

 $useradd supersite 

已下载的tomcat

 $wget http://apache.mirror.anlx.net/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.zip $unzip apache-tomcat-7.0.42.zip -d tomcat7 

创build服务configuration:

 $ cd /etc/init.d $ edit tomcat7-supersite 

我从这里复制文件。

但是,当我尝试以root用户身份运行(我看到我是root @ myip)

 service tomcat7-supersite start 

我得到:

 env: /etc/init.d/tomcat7-supersite: Permission denied 

为什么?

文件/etc/init.d/tomcat7-supersite缺less执行权限。 你需要运行

 sudo chmod +x /etc/init.d/tomcat7-supersite