Ray
Ray

Reputation: 6115

tomcat 7, grails app, finding the running webapp?

I installed Tomcat 7 on CentOS 6 and everything is running good, is running as service, can start and stop it, log file looks fine.

BUT, it doesn't respond to my webapp address, so I've got something wrong ...

I'm able to access tomcat externally on: www.my-domain.us:8080 (standard welcome Apache Tomcat 7 page), but when I try to access it under my application which is called cpn, I cannot. I am trying:

www.my-domain.us:8080/cpn
www.my-domain.us/cpn
www.my-domain.us:8080/cpn/cpn

The cpn.war file was exploded properly by Tomcat in webapps, i.e. I have a

 .../webapps/cpn/* directory

In application.properties the app.name=cpn.

Also, in Config.groovy I have:

 grails.serverURL = "http://www.my-domain.us"

What am I doing wrong?

Upvotes: 0

Views: 431

Answers (1)

Ian Roberts
Ian Roberts

Reputation: 122414

If it's not responding at all then it probably didn't start up successfully, check the log files for "startup failed due to previous errors". A common problem can be if Grails is trying to create its default stacktrace.log log file but the "current directory" whatever that is is not writable by the UID of the Tomcat process. You can eliminate this as a possibility by adding

'null' name:'stacktrace'

to the appenders block in your log4j closure in Config.groovy to turn off stacktrace.log altogether.

Also if your Tomcat is visible at www.my-domain.us:8080 then your grails.serverURL should be http://www.my-domain.us:8080/cpn, i.e. it should include the webapp context path as well as the host name and port number and should not end with a slash.

If you want the app to be deployed at the root context (http://www.my-domain.us:8080/) then you should name it ROOT.war instead of cpn.war and set grails.serverURL="http://www.my-domain.us:8080"

Upvotes: 1

Related Questions