Author Archives: peter

Dependency injection in the Grails Console

If you have a service named MyService with a function named HelloWorld, you can access it via dependency injection by adding def MyService def result = MyService.HelloWorld() But to test in the console you need to do this: def service … Continue reading

Posted in Grails | Comments Off

How to install Gradle on Ubuntu 10.10

Download zip file from http://www.gradle.org/downloads.html and unzip to folder $ sudo unzip gradle-1.0-milestone-3-all.zip -d /opt/gradle/ Edit PATH in the environment file $ sudo nano /etc/environment Add the following to the environment file PATH=”… :$GRADLE_HOME/bin” GRADLE_HOME=”/opt/gradle/gradle-1.0-milestone-3″ Reload environment variables source /etc/environment … Continue reading

Posted in Ubuntu | Comments Off

How to install Redmine with passenger on Ubuntu 10.10

$ sudo apt-get install redmine redmine-mysql subversion $ sudo ln -s /usr/share/redmine/public /var/www/redmine $ sudo apt-get install ruby1.8-dev $ sudo gem install passenger $ sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module $ sudo apt-get install build-essential libcurl4-openssl-dev libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev The Apache 2 module … Continue reading

Posted in Ubuntu | Leave a comment

Useful commands for ubuntu linux

How to transfer files over ssh $ scp /your/files/* user@server:/place/to/put/file How to delete non empty folder $ rm -rf folder_name

Posted in Ubuntu | Leave a comment

How to choose default Java version

Just installing new Java flavours does not change the default Java pointed to by /usr/bin/java. You must explicitly set this: Open a Terminal window Run sudo update-java-alternatives -l to see the current configuration and possibilities. Run sudo update-java-alternatives -s XXXX … Continue reading

Posted in Grails | Leave a comment

How to install Groovy on ubuntu 10.10

Download zip file from http://groovy.codehaus.org/ and unzip to folder $ sudo unzip groovy-binary-1.7.6.zip -d /opt/groovy/ Edit PATH in the environment file $ sudo nano /etc/environment Add the following to the environment file PATH=”… :$GROOVY_HOME/bin” GROOVY_HOME=”/opt/groovy/groovy-1.7.5″ Reload environment variables source /etc/environment … Continue reading

Posted in Ubuntu | Leave a comment

Using spring security core plugin

Install the plugin $ grails install-plugin spring-security-core Create domain classes for User Role and UserRole $ grails s2-quickstart com.yourapp User Role Create a persistent token domain class for storing remember-me cookie information in the database $ grails s2-create-persistent-token com.yourapp.PersistentLogin

Posted in Grails | Leave a comment

How to setup Tomcat and Apache via mod_proxy_ajp

This instruction is for an ubuntu server 10.10. Tomcat6 configuration Enable the AJP connector in the /etc/tomcat6/server.xml file like this: Connector port=”8009″ enableLookups=”false” redirectPort=”8443″ protocol=”AJP/1.3″ Restart the Tomcat server. $ sudo /etc/init.d/tomcat6 restart Apache2 configuration Enable the proxy and proxy_ajp … Continue reading

Posted in Apache / Tomcat | Leave a comment