Wednesday, December 10, 2008

Groovy and Grails setup on Ubuntu

I was looking for a web framework, that easily integrates with most of the opensource platforms, and also provide very strict MVC model for web application development, and came across few options. Options that I evaluated are Rub and Rails ( php), Groovy on Grails ( Java), Django ( Python). And opted to go with Groovy on Grails for its simplicity and support to pring framework.

Here are the steps on how to set it up on Ubuntu :

Install JDK
# sudo aptitude install sun-java6-jdk


Download Groovy and Grails

# wget http://dist.codehaus.org/groovy/distributions/installers/deb/groovy-1.6-beta-1.deb
# wget http://ant-deb-task.googlecode.com/files/grails_1.0.3-1_all.deb


Install Groovy and Grails
# sudo dpkg -i groovy-1.6-beta-1.deb
# sudo dpkg -i grails_1.0.3-1_all.deb


Configure Path
#sudo gedit /etc/environment

Make following changes in environment file
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/share/grails/bin"
JAVA_HOME=/usr/lib/jvm/java-6-sun
#This needs to be the directory where "dpkg" installed your grails
GRAILS_HOME=/usr/share/grails
#This needs to be the directory where "dpkg" installed your groovy
GROOVY_HOME=/usr/share/groovy

SAVE file and "LOGOUT" and "LOGIN" to Ubuntu. This is very important to reload the environment variables.

#grails

This should return following data :

Welcome to Grails 1.0.3 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/share/grails

No script name specified. Use 'grails help' for more info or 'grails interactive' to enter interactive mode


NOTE: If in the above message, the version number of Grails is not shown, then there is something wrong with the installation. I experienced this problem with version 1.0.4 beta, where the version was showing as "null", and hence I was not able to install plugins at a later time. With Groovy 1.6 beta and Grails 1.0.3 it all worked fine. Follow this link to learn more about this issue : http://markmail.org/message/a3qhdoi6rcwiqua6.

Building a sample login app with Grails :

# grails create-app samplelogin
# cd samplelogin
# grails install-plugin acegi
# grails create-auth-domains User Role Requestmap
# grails generate-manager
# grails generate-registration
# grails create-controller Secure
# grails run-app


That's it. Now you can connect to your Grails app by going to
http://localhost:8080/samplelogin

The default UI source files are located at this directory structure:
samplelogin/web-apps

Note : Files in Grails will have an extension as .gsp

FAQ :

1. Where can I find some sample apps on Grails ?
http://www.grails.org/Tutorials

2. How to I change default port settings for grails application ?
You can change the port number at command line
# grails -Dserver.port=9090 run-app
Or you can also configure the port in this config file :
GRAILS_HOME/scripts/Init.groovy

3. Where can I find command line reference for Grails commands ?
http://docs.codehaus.org/display/GRAILS/Command+Line

Reference links:

Grails and Groovy Installation steps
Grails main Home.
Groovy Main Home.
Grails Tutorials.

Thursday, June 28, 2007

Wubi : what a cute name for a smart tool

Now that Ubuntu is out and is used my 10's and thousands of developers, its time that all users of PC also get a taste of this new desktop system. But how ? well, you
can have a Live CD, that can run directly from a CD drive, and not install anything on your windows PC. This will enable you to experiment with Linux, without impacting
existing OS on the system. all you need to do is set your boot order to boot from CD drive, and then from HDD. Even though this will work, this Live CD approach will need lot of memory, and you may not be able to explore true potential of the new OS.

So here is another very nice solution : use Wubi to install OS on windows itself. Did you say What !! yes, you heard it right, Wubi is a ".exe" file,
using which you can install Ubuntu directly on windows XP machine. It creates a temporary partition and installs complete Ubuntu along with Windows OS, and also provided a boot menu. Using this boot menu at startup you can select either Windows or Ubuntu. After running this for weeks or months, and you are completely satisfied with Ubuntu, then you can move file systems to this partition, and make Ubuntu a permanent OS you want to use. Best of all, if you are not completely satisfied, you can just delete the OS by deleting files from one place.

This is new concept and will help you install and evaluate a OS, than like evaluate and install (in Live CD). This approach also provided you full benefit of keeping both OS as long as you want, and not boot and run your OS from a CD.

You can find all about Wubi here :

Wubi Homehttp://wubi-installer.org/

Informative blog about Wubi
http://agolb.blogspot.com/2007/06/why-wubi-is-important-for-linux.html

Ubuntu and meBuntu :)

These days I am spending a lot of my spare time during weekdays on 2 very great projects. They are Ubuntu : One of the best and flexible desktop Linux solutions from opensource community. Always having Linux as a desktop solution has been a challenge due to complex installation instruction etc for regular Linux distribution.

But Ubuntu...what can I say, it is a Gem that emerged from all the research and development of highly motivated individuals. It has truly evolved as a challenger for all other Linux desktop solutions and also to "THE WINDOOOOS".

It is so easy to install Ubuntu and play with packages, and applications. There are 100's of 1000's of application now ported to Ubuntu and are "FREELY" as in
"FREE WILLY" available. And best of all is that you can just use command line option "apt-get" to download and install any app directly on Ubuntu. One other OS that tried similar approach is "Linspire" which was also named Lindows (Competitor of windows), but they make this application library as a paid service.

You can now install Ubuntu along with Windows XP directly from a tool inside windows XP ! How cool is that. No more manual partition management, boot.ini edits etc. All done automatically by this neat little tool. (Note: it is not yet supported on Vista)
Check this out : https://wiki.ubuntu.com/install.exe/Prototype


I will write more about this installer in my next blog, and interesting facts I uncovered.

Thursday, February 22, 2007

Ubuntu the new wave

Ubuntu !
The moment I heard the name I was thrilled. Its such a nice cute name for a solution that is aimed towards providing this world with a open source Linux operating system.
Ubuntu is a word derived from African continent and means "Humanity towards others"
If you are interested to hear more about the word "Ubuntu", I have provided links at the end of this this blog, where Nelson Mandela explains what Ubuntu is all about.

Now, to the actual opensource platform itself. It is a great start so far for a OS, that can be easily installed, and has all the required solutions ( word processing, music, video playback and internet browsing) included as a package.

Here is a youtube video of Nelson Mandela explaining Ubuntu :
Ubuntu Video
http://www.youtube.com/watch?v=Dx0qGJCm-qU

Open source everywhere

Welcome. Here you will find anything and everything related to open source technologies, and my experience and review with various such open source solutions available today.

In coming weeks, you will find focused discussions on specific areas of open source solutions available today.

Keep reading my blog, and keep the open source revolution moving..