Assignment 6, 7. 

Assignment 6: Grails. 

Let's go back to our Tomcat servers. 

I show how Dimas did Homework Six in class. 

I included additional information here:

https://www.cs.indiana.edu/classes/c212-dgerman/spr2015/hwSix.html

All of this is done through PuTTY.

Windows? Mac? 

https://kb.iu.edu/

https://kb.iu.edu/d/bdnt

ssh -Y username@bigred2.uits.iu.edu

For Windows you need to activate third party utilities:

http://www.cs.indiana.edu/classes/h211-dgerman/fall2014/mo.html

I would like to demonstrate how to do Assignment 6 and 7 now. 

I go in as Tim and I ask for port 14694, is it available? 

[tmarlett@silo ~]$ netstat -a | grep 14694
[tmarlett@silo ~]$ netstat -a | grep 8364
unix  2      [ ACC ]     STREAM     LISTENING     3418503794 /tmp/orbit-xiaopan/linc-538c-0-4d983640b323f
unix  3      [ ]         STREAM     CONNECTED     3446418364 /tmp/orbit-tuckerje/linc-1fdd-0-e076f1c53d9
unix  3      [ ]         STREAM     CONNECTED     3420354489 /tmp/orbit-xiaopan/linc-538c-0-4d983640b323f
unix  3      [ ]         STREAM     CONNECTED     3418508533 /tmp/orbit-xiaopan/linc-538c-0-4d983640b323f
unix  3      [ ]         STREAM     CONNECTED     3418503797 /tmp/orbit-xiaopan/linc-538c-0-4d983640b323f
[tmarlett@silo ~]$

So it is, so we get it. 

[tmarlett@silo ~]$ pwd
/u/tmarlett
[tmarlett@silo ~]$ ls
apache-tomcat-7.0.35  apache-tomcat-7.0.35.tar  bin  README
[tmarlett@silo ~]$ cp /l/www/classes/c212/software/grails-2.3.4.zip ~
[tmarlett@silo ~]$ ls
apache-tomcat-7.0.35  apache-tomcat-7.0.35.tar  bin  grails-2.3.4.zip  README
[tmarlett@silo ~]$

From this I type: 

  102  unzip grails-2.3.4.zip
  105  cd grails-2.3.4

And this is where I am at the moment:

[tmarlett@silo grails-2.3.4]$ pwd
/u/tmarlett/grails-2.3.4
[tmarlett@silo grails-2.3.4]$ ls -l
total 276
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 bin
-rw-r--r--  1 tmarlett students     22 Dec  5  2013 build.properties
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 conf
drwxr-xr-x  2 tmarlett students  40960 Dec  5  2013 dist
drwxr-xr-x  3 tmarlett students   4096 Dec  5  2013 doc
drwxr-xr-x  3 tmarlett students   4096 Dec  5  2013 dsl-support
-rw-r--r--  1 tmarlett students    117 Feb 14  2012 INSTALL
drwxr-xr-x 71 tmarlett students   4096 Dec  5  2013 lib
-rw-r--r--  1 tmarlett students 190422 Oct 17  2013 LICENSE
drwxr-xr-x  4 tmarlett students   4096 Feb 14  2012 media
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 plugins
-rw-r--r--  1 tmarlett students   2554 Aug 29  2013 README
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 scripts
drwxr-xr-x  5 tmarlett students   4096 Dec  5  2013 src
[tmarlett@silo grails-2.3.4]$

This is my 2.3.4 version of grails:

[tmarlett@silo grails-2.3.4]$ pwd
/u/tmarlett/grails-2.3.4
[tmarlett@silo grails-2.3.4]$ ls -l
total 276
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 bin
-rw-r--r--  1 tmarlett students     22 Dec  5  2013 build.properties
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 conf
drwxr-xr-x  2 tmarlett students  40960 Dec  5  2013 dist
drwxr-xr-x  3 tmarlett students   4096 Dec  5  2013 doc
drwxr-xr-x  3 tmarlett students   4096 Dec  5  2013 dsl-support
-rw-r--r--  1 tmarlett students    117 Feb 14  2012 INSTALL
drwxr-xr-x 71 tmarlett students   4096 Dec  5  2013 lib
-rw-r--r--  1 tmarlett students 190422 Oct 17  2013 LICENSE
drwxr-xr-x  4 tmarlett students   4096 Feb 14  2012 media
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 plugins
-rw-r--r--  1 tmarlett students   2554 Aug 29  2013 README
drwxr-xr-x  2 tmarlett students   4096 Dec  5  2013 scripts
drwxr-xr-x  5 tmarlett students   4096 Dec  5  2013 src
[tmarlett@silo grails-2.3.4]$ pico -w .grails-setup
[tmarlett@silo grails-2.3.4]$ echo $GRAILS_HOME

[tmarlett@silo grails-2.3.4]$ source .grails-setup
[tmarlett@silo grails-2.3.4]$ echo $GRAILS_HOME
/u/tmarlett/grails-2.3.4
[tmarlett@silo grails-2.3.4]$

At this point all is ready to go. 

[tmarlett@silo apache-tomcat-7.0.35]$ history
    1  xeyes
    2  xclock
    3  cat GoTYPong.rkt
    4  xcalculator
    5  help
    6  help xeyes
    7  help x
    8  help
    9  exit
   10  emacs
   11  pwd
   12  cp /l/www/classes/a348/spr2013/software/apache-tomcat-7.0.35.tar.gz .
   13  ls
   14  ls -l
   15  pwd
   16  ls -ld apa*
   17  gunzip apache-tomcat-7.0.35.tar.gz
   18  ls -ld apa*
   19  tar xf apache-tomcat-7.0.35.tar.gz
   20  tar xf apache-tomcat-7.0.35.tar
   21  ls -ld apa*
   22  pwd
   23  ls -l
   24  cd apache-tomcat-7.0.35
   25  pwd
   26  ls
   27  pwd
   28  ls
   29  cd conf
   30  ls
   31  mv server.xml server-distr.xml
   32  ls -l
   33  pico -w server.xml
   34  ls-l
   35  cat server.xml
   36  cd apache-tomcat-7.0.35
   37  cd conf
   38  ls -l
   39  mv server.xml server-distr.xml
   40  ls -l
   41  cat server.xml
   42  cd conf
   43  pico -w server.xml
   44  ls -l
   45  mv conf
   46  cd c
   47  reset
   48  ls
   49  ls -l
   50  cat server.xml
   51  up
   52  up conf
   53  cd apache-tomcat-7.0.35
   54  cd conf
   55  ls- l
   56  ls -l
   57  cd apache-tomct-7.0.35
   58  help
   59  dirs
   60  dirs +1
   61  dirs -1
   62  1 + 1
   63  cd apache-tomcat-7.0.35
   64  ls -l
   65  pico -w server.xml
   66  ls -l
   67  mv server.xml conf
   68  ls -l
   69  cd conf
   70  ls -l
   71  mv server.xml server-distr.xml
   72  ls- l
   73  ls -l
   74  cat server.xml
   75  pico -w server-distr.xml
   76  pico -w server.xml
   77  cat server.xml
   78  pico -w server.xml
   79  cat server.xml
   80  pwd
   81  pico -w
   82  pico -w ~/.bash_profile
   83  echo $JAVA_HOME
   84  source ~/.bash_profile
   85  echo $JAVA_HOME
   86  tail -10 ~/.bash_profile
   87  pico -w ~/.bash_profile
   88  pwd
   89  echo $JAVA_HOME
   90  tail -10 ~/.bash_profile
   91  $CATALINA_HOME/bin/startup.sh
   92  clear
   93  netstat -a | grep 14694
   94  netstat -a | grep 8364
   95  clear
   96  pwd
   97  ls
   98  cp /l/www/classes/c212/software/grails-2.3.4.zip ~
   99  ls
  100  clear
  101  ls -ld grai*
  102  unzip grails-2.3.4.zip
  103  clear
  104  ls
  105  cd grails-2.3.4
  106  pwd
  107  ls -l
  108  clear
  109  pwd
  110  history
  111  clear
  112  pwd
  113  ls
  114  clear
  115  pwd
  116  ls -l
  117  clear
  118  pwd
  119  ls -l
  120  pico -w .grails-setup
  121  echo $GRAILS_HOME
  122  source .grails-setup
  123  echo $GRAILS_HOME
  124  which grails
  125  clear
  126  pwd
  127  cp /l/www/classes/c212/software/graina2-master.zip ~
  128  ls
  129  ls ~
  130  cd ..
  131  ls
  132  unzip graina2-master.zip
  133  clear
  134  ls
  135  cd graina2-master
  136  ls -l
  137  cd ch01
  138  ls
  139  clear
  140  pwd
  141  ls -l
  142  cd qotd/
  143  ls
  144  ls -l
  145  cat application.properties
  146  clear
  147  ( nohup grails run-app -Dserver.port=14694 --non-interactive 2>&1 > /dev/null & )
  148  ps -ef | grep tmarlett
  149  kill 5099
  150  clear
  151  pwd
  152  clear
  153  ps -ef | grep tmarlet
  154  pwd
  155  ls -l
  156  clear
  157  grails -Dserver.port=14694 run-app
  158  ( nohup grails run-app -Dserver.port=14694 --non-interactive 2>&1 > /dev/null & )
  159  pwd
  160  cd
  161  ls -l
  162  cd apache-tomcat-7.0.35
  163  clear
  164  pwd
  165  ls -l
  166  echo $CATALINA_HOME
  167  cat ~/.profile
  168  clear
  169  cat ~/.bash_profile
  170  clear
  171  /u/tmarlett/apache-tomcat-7.0.35/bin/startup.sh
  172  pwd
  173  pico -w /u/tmarlett/apache-tomcat-7.0.35/webapps/ROOT/index.html
  174  ps -ef | grep tmarl
  175  history
[tmarlett@silo apache-tomcat-7.0.35]$

More: 

[tmarlett@silo qotd]$ history
    1  xeyes
    2  xclock
    3  cat GoTYPong.rkt
    4  xcalculator
    5  help
    6  help xeyes
    7  help x
    8  help
    9  exit
   10  emacs
   11  pwd
   12  cp /l/www/classes/a348/spr2013/software/apache-tomcat-7.0.35.tar.gz .
   13  ls
   14  ls -l
   15  pwd
   16  ls -ld apa*
   17  gunzip apache-tomcat-7.0.35.tar.gz
   18  ls -ld apa*
   19  tar xf apache-tomcat-7.0.35.tar.gz
   20  tar xf apache-tomcat-7.0.35.tar
   21  ls -ld apa*
   22  pwd
   23  ls -l
   24  cd apache-tomcat-7.0.35
   25  pwd
   26  ls
   27  pwd
   28  ls
   29  cd conf
   30  ls
   31  mv server.xml server-distr.xml
   32  ls -l
   33  pico -w server.xml
   34  ls-l
   35  cat server.xml
   36  cd apache-tomcat-7.0.35
   37  cd conf
   38  ls -l
   39  mv server.xml server-distr.xml
   40  ls -l
   41  cat server.xml
   42  cd conf
   43  pico -w server.xml
   44  ls -l
   45  mv conf
   46  cd c
   47  reset
   48  ls
   49  ls -l
   50  cat server.xml
   51  up
   52  up conf
   53  cd apache-tomcat-7.0.35
   54  cd conf
   55  ls- l
   56  ls -l
   57  cd apache-tomct-7.0.35
   58  help
   59  dirs
   60  dirs +1
   61  dirs -1
   62  1 + 1
   63  cd apache-tomcat-7.0.35
   64  ls -l
   65  pico -w server.xml
   66  ls -l
   67  mv server.xml conf
   68  ls -l
   69  cd conf
   70  ls -l
   71  mv server.xml server-distr.xml
   72  ls- l
   73  ls -l
   74  cat server.xml
   75  pico -w server-distr.xml
   76  pico -w server.xml
   77  cat server.xml
   78  pico -w server.xml
   79  cat server.xml
   80  pwd
   81  pico -w
   82  pico -w ~/.bash_profile
   83  echo $JAVA_HOME
   84  source ~/.bash_profile
   85  echo $JAVA_HOME
   86  tail -10 ~/.bash_profile
   87  pico -w ~/.bash_profile
   88  pwd
   89  echo $JAVA_HOME
   90  tail -10 ~/.bash_profile
   91  $CATALINA_HOME/bin/startup.sh
   92  clear
   93  netstat -a | grep 14694
   94  netstat -a | grep 8364
   95  clear
   96  pwd
   97  ls
   98  cp /l/www/classes/c212/software/grails-2.3.4.zip ~
   99  ls
  100  clear
  101  ls -ld grai*
  102  unzip grails-2.3.4.zip
  103  clear
  104  ls
  105  cd grails-2.3.4
  106  pwd
  107  ls -l
  108  clear
  109  pwd
  110  history
  111  clear
  112  pwd
  113  ls
  114  clear
  115  pwd
  116  ls -l
  117  clear
  118  pwd
  119  ls -l
  120  pico -w .grails-setup
  121  echo $GRAILS_HOME
  122  source .grails-setup
  123  echo $GRAILS_HOME
  124  which grails
  125  clear
  126  pwd
  127  cp /l/www/classes/c212/software/graina2-master.zip ~
  128  ls
  129  ls ~
  130  cd ..
  131  ls
  132  unzip graina2-master.zip
  133  clear
  134  ls
  135  cd graina2-master
  136  ls -l
  137  cd ch01
  138  ls
  139  clear
  140  pwd
  141  ls -l
  142  cd qotd/
  143  ls
  144  ls -l
  145  cat application.properties
  146  clear
  147  ( nohup grails run-app -Dserver.port=14694 --non-interactive 2>&1 > /dev/null & )
  148  ps -ef | grep tmarlett
  149  kill 5099
  150  clear
  151  pwd
  152  clear
  153  ps -ef | grep tmarlet
  154  pwd
  155  ls -l
  156  clear
  157  grails -Dserver.port=14694 run-app
  158  ( nohup grails run-app -Dserver.port=14694 --non-interactive 2>&1 > /dev/null & )
  159  pwd
  160  cd
  161  ls -l
  162  cd apache-tomcat-7.0.35
  163  clear
  164  pwd
  165  ls -l
  166  echo $CATALINA_HOME
  167  cat ~/.profile
  168  clear
  169  cat ~/.bash_profile
  170  clear
  171  /u/tmarlett/apache-tomcat-7.0.35/bin/startup.sh
  172  pwd
  173  pico -w /u/tmarlett/apache-tomcat-7.0.35/webapps/ROOT/index.html
  174  ps -ef | grep tmarl
  175  history
  176  clear
  177  pwd
  178  cd
  179  clear
  180  pwd
  181  ls
  182  ls -l
  183  clear
  184  ls -l
  185  cd graina2-master
  186  ls -l
  187  cd ch01
  188  ls
  189  cd qotd
  190  ls -l
  191  clear
  192  pwd
  193  cd
  194  cd $CATALINA_HOME
  195  clear
  196  cd conf/
  197  pico -w server
  198  pico -w server.xml
  199  /u/tmarlett/apache-tomcat-7.0.35/bin/shutdown.sh
  200  clear
  201  pwd
  202  ps -ef | grep marlet
  203  kill 7943
  204  ps -ef | grep marlet
  205  clear
  206  pwd
  207  pico -w server.xml
  208  pwd
  209  cd ../logs/
  210  ls
  211  rm *
  212  clear
  213  pwd
  214  cklear
  215  clear
  216  /u/tmarlett/apache-tomcat-7.0.35/bin/startup.sh
  217  ls -l
  218  more *
  219
  220  clear
  221  history | grep grails
  222  ( nohup grails run-app -Dserver.port=14694 --non-interactive 2>&1 > /dev/null & )
  223  pwd
  224  cd ../webapps/ROOT/
  225  pico -w index.html
  226  clear
  227  ps -ef | grep marlett
  228  cd
  229  cd graina2-master
  230  cd ch01
  231  cd qotd/
  232  ls
  233  ( nohup grails run-app -Dserver.port=14694 --non-interactive 2>&1 > /dev/null & )
  234  clear
  235  ps -ef | grep marlet
  236  history
[tmarlett@silo qotd]$

--


[tmarlett@silo qotd]$ pwd
/u/tmarlett/graina2-master/ch01/qotd
[tmarlett@silo qotd]$ cd
[tmarlett@silo ~]$ cd $CATALINA_HOME
[tmarlett@silo apache-tomcat-7.0.35]$ cd webapps/
[tmarlett@silo webapps]$ cd ROOT/
[tmarlett@silo ROOT]$ pico -w index.html
[tmarlett@silo ROOT]$ cat index.html
My name is Tim. <p>

<img src="http://www.thenationals.net/aimhigh2.gif"> <p>

Here's my Gr<a href="http://silo.cs.indiana.edu:14694/qotd/quote/random">ails development serv</a>er.
[tmarlett@silo ROOT]$