Grails Install Instructions

From A2 Hosting : Wiki Support : Customer Edited Wiki : 24/7 Support
(Redirected from Grails)
Jump to: navigation, search

Grails Hosting

Grails and Tomcat can be installed on our CentOS VPS Hosting accounts with our QuickInstaller. Run the following command via SSH: (not available on Managed VPS)

sh /usr/sbin/quickinstaller.sh

Choose the "Install Grails and Tomcat" option from the presented menu.

Following the Creating an Application guide here will get you a quick tutorial on how to create your first 'Hello World' Grails application:

http://grails.org/doc/latest/guide/2.%20Getting%20Started.html#2.3 

Creating an Application (When you go to view your newly created app, you will not be able to use the development url that the following command will provide you):

 grails run-app
 

Provided URL looks like:

 http://localhost:8080/my-new-app
 

This is because they believe you are doing your development on your PC and not remotely. To view your newly created application, you will need to follow the deployment steps here:

http://grails.org/doc/latest/guide/2.%20Getting%20Started.html#2.9 Deploying an Application

These consist of running the following command in your application directory:

grails war

Once you have the war file created, copy it to the tomcat webapps directory. The war file location is listed as the last line from the "grails war" command you ran above.

cp /path/to/war/file /opt/tomcat-7/webapps/

For example:

cp /root/my-new-app/target/my-new-app-0.1.war /opt/tomcat-7/webapps/

Now start up tomcat:

/opt/tomcat-7/bin/catalina.sh start

Now you can view your application through the web:

http://your-vps-ip:8080/yourwebapp

For example:

http://127.0.0.1:8080/my-new-app

You should be presented with a welcome page similar to this:

Welcome to Grails Congratulations, you have successfully started your first Grails application! At the moment this is the default page, feel free to modify it to either redirect to a controller or display whatever content you may choose. Below is a list of controllers that are currently deployed in this application, click on each to execute its default action:

Further documentation and assistance can be found here:

Grails Documentation: http://grails.org/Documentation

Grails Assistance: http://grails.org/Community

Tomcat 7 Documentation: http://tomcat.apache.org/tomcat-7.0-doc/index.html

Tomcat 7 Mailing Lists: http://tomcat.apache.org/lists.html

Personal tools