Installation of Grails on silo is described here: 

http://www.cs.indiana.edu/classes/a348/spr2013/lectureEleven.html

Next create the application:

-bash-4.1$ pwd
/u/dgerman
-bash-4.1$ grails --version

Grails version: 2.2.0
-bash-4.1$ grails create-app teamwork
| Created Grails Application at /nfs/nfs3/home/dgerman/teamwork
-bash-4.1$ ls -ld teamwork/
drwxr-xr-x 8 dgerman faculty 4096 Apr 22 11:47 teamwork/
-bash-4.1$ cd teamwork/
-bash-4.1$ ls
application.properties  grails-app  lib  scripts  src  test  web-app
-bash-4.1$

Note the structure of the application folder. 

Also, we're following this reference in our development:

https://www.cs.indiana.edu/~dgerman/spr2013/materials/grails11.pdf

We can already run the application now:

-bash-4.1$ pwd
/u/dgerman/teamwork
-bash-4.1$ grails -Dserver.port=19662 run-app
| Compiling 116 source files

| Server running. Browse to http://localhost:19662/teamwork
-bash-4.1$
-bash-4.1$

On-line we check this at: 

     http://silo.cs.indiana.edu:19662/teamwork/


Now let's define some classes:

-bash-4.1$ pwd
/u/dgerman/teamwork
-bash-4.1$ grails create-domain-class app.User
| Created file grails-app/domain/app/User.groovy
| Created file test/unit/app/UserTests.groovy
-bash-4.1$ grails create-domain-class app.Role
| Created file grails-app/domain/app/Role.groovy
| Created file test/unit/app/RoleTests.groovy
-bash-4.1$ cd grails-app/
-bash-4.1$ ls
conf  controllers  domain  i18n  migrations  services  taglib  utils  views
-bash-4.1$ cd domain/app/
-bash-4.1$ ls
Role.groovy  User.groovy
-bash-4.1$ cat User.groovy
package app

class User {

    static constraints = {
    }
}
-bash-4.1$ pico -w User.groovy
-bash-4.1$ cat User.groovy
package app

class User {

    String username
    String title
    String firstName
    String lastName
    String password
    Date dateCreated
    Date lastModified

    static constraints = {
    }
}
-bash-4.1$

Let's do the same with the Role domain class: 

-bash-4.1$ pwd
/u/dgerman/teamwork/grails-app/domain/app
-bash-4.1$ ls
Role.groovy  User.groovy
-bash-4.1$ cat Role.groovy
package app

class Role {

    static constraints = {
    }
}
-bash-4.1$ pico -w Role.groovy
-bash-4.1$ cat Role.groovy
package app

class Role {

    String name

    static constraints = {
    }
}
-bash-4.1$


Now it's time to create controllers to enable scaffolding: 

-bash-4.1$ pwd
/u/dgerman/teamwork/grails-app/domain/app
-bash-4.1$ cd ~/teamwork/
-bash-4.1$ ls
application.properties  grails-app  lib  scripts  src  target  test  web-app
-bash-4.1$ grails create-controller app.User
| Created file grails-app/controllers/app/UserController.groovy
| Created file grails-app/views/user
| Created file test/unit/app/UserControllerTests.groovy
-bash-4.1$ grails create-controller app.Role
| Created file grails-app/controllers/app/RoleController.groovy
| Created file grails-app/views/role
| Created file test/unit/app/RoleControllerTests.groovy
-bash-4.1$ cd grails-app/controllers/app/
-bash-4.1$ ls
RoleController.groovy  UserController.groovy
-bash-4.1$ cat UserController.groovy
package app

class UserController {

    def index() { }
}
-bash-4.1$ cat RoleController.groovy
package app

class RoleController {

    def index() { }
}
-bash-4.1$

Follow the instructions in the book for [p. 22] these modifications: 

-bash-4.1$ cd
-bash-4.1$ cd teamwork/
-bash-4.1$ ls
application.properties  grails-app  lib  scripts  src  target  test  web-app
-bash-4.1$ cd grails-app/
-bash-4.1$ ls
conf  controllers  domain  i18n  migrations  services  taglib  utils  views
-bash-4.1$ cd controllers/
-bash-4.1$ ls
app
-bash-4.1$ cd app/
-bash-4.1$ ls
RoleController.groovy  UserController.groovy
-bash-4.1$ pico -w UserController.groovy
-bash-4.1$ cat UserController.groovy
package app

class UserController {

    def scaffold = User
}
-bash-4.1$ cat RoleController.groovy
package app

class RoleController {

    def index() { }
}
-bash-4.1$ pico -w RoleController.groovy
-bash-4.1$ cat RoleController.groovy
package app

class RoleController {

    def scaffold = Role
}
-bash-4.1$ pwd
/u/dgerman/teamwork/grails-app/controllers/app
-bash-4.1$

We're now at the bottom of page 22. 

-bash-4.1$ pwd
/u/dgerman/teamwork
-bash-4.1$ ls
application.properties  grails-app  lib  scripts  src  target  test  web-app
-bash-4.1$ cat ~/.grails.profile
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun.x86_64

export CATALINA_HOME=/u/dgerman/apache-tomcat-7.0.35

export CLASSPATH=.:$CATALINA_HOME/common/lib/servlet-api.jar

export CLASSPATH=.

export GRAILS_HOME=~/grails

export PATH="$PATH:$GRAILS_HOME/bin"

-bash-4.1$ source ~/.grails.profile
-bash-4.1$ which grails
~/grails/bin/grails
-bash-4.1$ grails -Dserver.port=19662 run-app
| Server running. Browse to http://localhost:19662/teamwork

Now the page has changed, as indicated in the book. 

Click on the app.UserConroller.list which means: 

http://silo.cs.indiana.edu:19662/teamwork/user/list

The scaffolding is impressive. 

Now let's deploy this:

-bash-4.1$ grails war teamwork.war
| Done creating WAR teamwork.war
-bash-4.1$ pwd
/u/dgerman/teamwork
-bash-4.1$ ls
application.properties  grails-app  lib  scripts  src  target  teamwork.war  test  web-app
-bash-4.1$

Then take this to your webapps:

 1061  cd
 1062  cd $CATALINA_HOME
 1063  cd webapps/
 1064  ls
 1065  pwd
 1066  ps -ef | grep dgerman

Here I noticed that I didn't have Tomcat running.

 1067  /u/dgerman/apache-tomcat-7.0.35/bin/startup.sh

I start it. 

 1068  pwd

I check where I am (webapps, see above) then I copy the .war file:

 1069  cp ~/teamwork/teamwork.war .
 1070  pwd

I again check to determine where conf is: 

 1071  cat ../conf/server.xml

I find my port and call online: 

http://silo.cs.indiana.edu:17662/teamwork/

Everything works like a charm. 

Of course for the database to be associated with this we need to modify server.xml

[to be continued]