Changes between Version 2 and Version 3 of QuickStart
- Timestamp:
- Feb 7, 2011, 3:52:40 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QuickStart
v2 v3 20 20 If you run from source from command line, you don't need to set up a database as the default development configuration runs on an in-memory HSQLDB database. 21 21 22 The following list of commands is known to work under Ubuntu 8.04, provided you have put <pre>grails-1.3.4</pre> in <pre>/app</pre> and installed <pre>sun-java6-jdk</pre>:22 The following list of commands is known to work under Ubuntu 8.04, provided you have put {{{grails-1.3.4}}} in {{{/app}}} and installed {{{sun-java6-jdk}}}: 23 23 {{{ 24 24 export JAVA_HOME=/usr/lib/jvm/java-6-sun … … 53 53 54 54 When you run 'grails run-app' (as NetBeans does behind the scenes), grails automatically installs any plugins on which the application is depending. To view which plugins are in your Grails cache, run: 55 <pre>ls ~/.grails/1.1.1/plugins</pre> 55 {{{ls ~/.grails/1.1.1/plugins}}} 56 56 * As of Grails 1.3.1, the plugin structure has changed, and this causes sometimes 'plugin not found' errors even on a fresh Grails download and project checkout. Try running 'grails upgrade', that should solve the problem. 57 57 * It seems that NetBeans sometimes has trouble installing the Nimble plugin, so if it's not there (grails-nimble-0.3-SNAPSHOT.zip), try running 'grails run-app' from the command line in the application directory. … … 63 63 64 64 To create the Postgres database (be sure to set authentication to md5 in pg_hba.conf): 65 <pre> 65 {{{ 66 66 sudo -u postgres createuser -d -R -P gscf; 67 67 sudo -u postgres createdb -O gscf gscf; 68 68 (and enter 'dbnp' as password) 69 </pre> 69 }}} 70 70 71 71 To create the empty database in MySQL (not tested for all versions of GSCF): 72 <pre> 72 {{{ 73 73 $ mysql --user=root 74 74 mysql> create database gscf; … … 77 77 mysql> flush privileges; 78 78 mysql> exit 79 </pre> 79 }}} 80 80 81 81 Also, make sure the right connector JARs are in the application /lib folder (both MySQL and Postgres drivers are in SVN now). … … 83 83 If you set this up correctly, just run the application in production mode and you will see that the database is filled: 84 84 85 <pre> 85 {{{ 86 86 $ mysql --user=gscf -p --database=gscf 87 87 mysql> show tables; … … 98 98 | _user_passwd_history | 99 99 ... 100 </pre> 100 }}} 101 101 102 102 === Testing === … … 110 110 ==== Deploy in a Tomcat container ==== 111 111 112 To generate a production WAR, use <pre>grails prod war</pre>112 To generate a production WAR, use {{{grails prod war}}} 113 113 114 114 You can deploy this on Tomcat 6. 115 115 Known issues: 116 * If you downloaded Tomcat for Ubuntu, do not forget to set executable file properties to the scripts in /bin: <pre>chmod u+x *.sh</pre>117 * You need to increase the PermGenSpace, otherwise Tomcat will crash. This can be done by setting <pre>export CATALINA_OPTS="-Xmx1024M -XX:MaxPermSize=256M"</pre>118 * You need to upgrade to the latest version of JQuery plugin 1.4.1.1 (see http://jira.codehaus.org/browse/GRAILSPLUGINS-1864), otherwise you will get an error concerning JQueryTagLib: <pre>org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.catalina.loader.WebappClassLoader' to required type 'groovy.lang.GroovyClassLoader' for property 'classLoader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.catalina.loader.WebappClassLoader] to required type [groovy.lang.GroovyClassLoader] for property 'classLoader': no matching editors or conversion strategy found</pre>116 * If you downloaded Tomcat for Ubuntu, do not forget to set executable file properties to the scripts in /bin: {{{chmod u+x *.sh}}} 117 * You need to increase the PermGenSpace, otherwise Tomcat will crash. This can be done by setting {{{export CATALINA_OPTS="-Xmx1024M -XX:MaxPermSize=256M"}}} 118 * You need to upgrade to the latest version of JQuery plugin 1.4.1.1 (see http://jira.codehaus.org/browse/GRAILSPLUGINS-1864), otherwise you will get an error concerning JQueryTagLib: {{{org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.catalina.loader.WebappClassLoader' to required type 'groovy.lang.GroovyClassLoader' for property 'classLoader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.catalina.loader.WebappClassLoader] to required type [groovy.lang.GroovyClassLoader] for property 'classLoader': no matching editors or conversion strategy found}}} 119 119 * The searchable plugin sometimes causes errors: http://n4.nabble.com/searchable-tomcat6-fail-td1339718.html - temporary fix: delete searchable plugin and searchable and plugin controllers+views 120 * we use scaffolding, so make sure all scaffolding files (like Controller.groovy) are present in /src/templates/scaffolding when you build the war. You can install them with <pre>grails install-templates</pre>120 * we use scaffolding, so make sure all scaffolding files (like Controller.groovy) are present in /src/templates/scaffolding when you build the war. You can install them with {{{grails install-templates}}} 121 121 122 122 ==== Set up a virtual host in Apache ==== … … 129 129 First, we have to define the AJP 1.3 connector to the Tomcat instance. Assuming it's running on port 8080 here: 130 130 131 <pre> 131 {{{ 132 132 worker.list=gscf 133 133 … … 135 135 worker.gscf.host=localhost 136 136 worker.gscf.port=8080 137 </pre> 137 }}} 138 138 139 139 ===== jk-httpd.conf ===== … … 141 141 Next, we have to configure JK to mount the actual GSCF instance on the worker. Assuming it's running on <server url>:<tomcat port>/gscf-0.4.0 here: 142 142 143 <pre> 143 {{{ 144 144 LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so 145 145 … … 165 165 #JkMount /gscf-0.4.0/* gscf 166 166 #JkMount /gscf-0.4.0 gscf 167 </pre> 167 }}} 168 168 169 169 ===== Set up virtual host ===== … … 173 173 174 174 So we create a file /sites-available/dbnp.org_example.conf: 175 <pre> 175 {{{ 176 176 <VirtualHost *:80> 177 177 ServerName example.dbnp.org … … 208 208 209 209 </VirtualHost> 210 </pre> 210 }}} 211 211 212 212 Then, we create a link to the file in /sites-enabled: 213 <pre> 213 {{{ 214 214 kees@server:/etc/apache2/sites-enabled$ sudo ln ../sites-available/dbnp.org_example.conf 215 </pre> 215 }}} 216 216 217 217 This will create a link to the configuration file we just created with the same name in the current directory, which should be sites-enabled. You can check this with ls -al.