LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   embedding grails-1.2.2 in apache2 (https://www.linuxquestions.org/questions/linux-server-73/embedding-grails-1-2-2-in-apache2-805128/)

tkmsr 04-30-2010 04:59 AM

embedding grails-1.2.2 in apache2
 
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
Code:

#! /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
/etc/default/bootlogd
BOOTLOGD_ENABLE=Yes

then I opened
/var/log/boot.
Code:

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
Code:

export GRAILS_HOME=/root/grails
export PATH="$PATH:$GRAILS_HOME/bin"

and in /etc/profile
[/code]
PATH="$JAVA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
[/code]
But it does not work. 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 to deploy my applications.

stuart_cherrington 04-30-2010 07:17 AM

In your RC script, where you have 'grails run-app' why not put the fullpath name for grails, I.e. /usr/local/bin/grails?

tkmsr 04-30-2010 07:28 AM

Quote:

Originally Posted by stuart_cherrington (Post 3952888)
In your RC script, where you have 'grails run-app' why not put the fullpath name for grails, I.e. /usr/local/bin/grails?

Well I extracted grails in /root so it is currently being called from /root/grails/bin.


All times are GMT -5. The time now is 07:20 PM.