View Full Version : [ubuntu] embedding grails grails-1.2.2 in apache2

April 30th, 2010, 10:43 AM
I downloaded grails http://grails.org and installed it.
Created a sample application hello world. It was running successfully.
In browser http://localhost:8080/helloworld
I was able to see grails running.
Now comes the problem.

To be able to always start the grails application running after boot
I wrote a script in /etc/init.d/software_grails

its contents are

#! /bin/sh
echo "Starting script grails for software"
cd /root/helloworld/
grails run-app
then update-rc.d software_grails default
so it create the scripts
now I reboot it the application could not be opened in browser

http://localhost:8080/helloworld (

I have to open command prompt and go to /root/helloworld
and then execute
grails run-app

you dont have to write the name of application to run it.
logging of boot messages is enabled

then I opened

Fri Apr 30 06:10:14 2010: Starting script grails for software
Fri Apr 30 06:10:14 2010: /etc/rc2.d/S20software_grails: line 4:
grails: command not found
where as in .bashrc

export GRAILS_HOME=/root/grails
export PATH="$PATH:$GRAILS_HOME/bin"
and in /etc/profile

If I am not wrong then above method will work only when some one Logs in not on boot time.
Is there a way where I can embed grails in apache2
they http://www.grails.org/Deployment/ have not mentioned any thing about apache2.