7

I just started using CentOS.

I install Java

yum install java-1.7.0-openjdk-devel

Added a user:

$useradd supersite

Downloaded 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

Created service configuration:

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

I copied the file from here.

However, when I try to run as root user (I see that I am root@myip)

service tomcat7-supersite start

I get:

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

Why?

Jenny D
  • 27,780
  • 21
  • 75
  • 114
Dejel
  • 195
  • 1
  • 1
  • 7

1 Answers1

19

The file /etc/init.d/tomcat7-supersite lacks the execute permission. You need to run

sudo chmod +x /etc/init.d/tomcat7-supersite
Jenny D
  • 27,780
  • 21
  • 75
  • 114