Akbarsait's Blog

Configuring and Running Railo Powered CFML Applications on Jelastic Cloud

I have been watching the Jelastic Cloud for almost a month and finally I gave it a try last week. The team behind Jelastic did all the ground works for us to get up and Running with Railo in their environment. I have configured Railo and created a sample job search application railoweb.akbarsait.com and hosted it in their Cloud in just 10 minutes time.


The below configuration information are one which I read and learned from our Community Geeks Matt Woodward, Sean Corfield, Todd Rafferty, Jamie Krug and the credits are go to them completely.

Before we move on just take a look at this video by the Jelastic team on Deploying Railo in Jelastic Cloud.

Installing Railo and Tomcat on Jelastic Cloud:

  • Signup for the Jelastic Cloud account and Create your environment by adding Tomcat 6, JDK 6 and MySQL.
  • Copy the latest Railo WAR file link from Railo download section.
  • Under Deployment manger, select Upload and enter the Railo WAR URL link. Wait until you see the railo.war is added to the Deployment Management section.
  • Now Deploy Railo to the environment you have created in the first step. Wait for a minute and once it gets installed click browse button to Launch the Railo administrator. The URL would be like this yourenvironmentname.jelastic.servint.net

    Configuring and Running Railo Powered ColdFusion Applications on Jelastic Cloud

  • In case if you are not able to view Railo Administrator and getting any 502 or related errors then go and refresh your environment and try again.

Configuring a Railo powered ColdFusion site:

  • Click on the Config icon in your Tomcat setting and select the catalina.properties file under the server folder and add your Railo paths to common.loader class path and save it.

    #Added the Railo *.JAR path
    common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/webapps/ROOT/WEB-INF/lib/*.jar

    Note: Currently Jelastic allows us to upload new files, create files and folders under your /opt/tomcat/(catlina.home) of your environment. We could not able to perform any file or folder moving functionality during this beta. Hence I kept the Railo JAR files under the default installed location and appended this path to the existing common.loader class as below.

    ${catalina.home}/webapps/ROOT/WEB-INF/lib/*.jar"
  • Open web.xml file and paste the following contents under the , and sections and save it.

    <!-- Railo Servlet section-->
    <servlet>
       <servlet-name>GlobalCFMLServlet</servlet-name>
       <description>CFML runtime Engine</description>
       <servlet-class>railo.loader.servlet.CFMLServlet</servlet-class>
       <init-param>
          <param-name>configuration</param-name>
          <param-value>{web-root-directory}/WEB-INF/railo/</param-value>
          <description>Configuraton directory</description>
       </init-param>
       <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
       <servlet-name>GlobalAMFServlet</servlet-name>
       <description>AMF Servlet for flash remoting</description>
       <servlet-class>railo.loader.servlet.AMFServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
       <servlet-name>GlobalRailoFileServlet</servlet-name>
       <description>File Servlet for simple files</description>
       <servlet-class>railo.loader.servlet.FileServlet</servlet-class>
       <load-on-startup>2</load-on-startup>
    </servlet>

    <!-- Railo Servlet Mapping section-->
    <servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>*.cfm</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>/index.cfm/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>*.cfml</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>GlobalCFMLServlet</servlet-name>
    <url-pattern>*.cfc</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>GlobalAMFServlet</servlet-name>
    <url-pattern>/flashservices/gateway/*</url-pattern>
    </servlet-mapping>

    <!-- Added Index.cfm to welcome File list section -->
    <welcome-file>index.cfm</welcome-file>
  • Create a folder called railoweb under webapps directory and upload a index.cfm file with some dynamic contents in it.
  • Create a custom domain or a CNAME entry with your existing domain and point it to the environmentname.jelastic.servint.net and add the CNAME entry to Custom domains section. I have created one called railoweb.akbarsait.com for this purpose.
  • Open server.xml and add the following host entry to it and save.

    <Host name="railotomcat.akbarsait.com" appBase="webapps"
          unpackWARs="true" autoDeploy="true" xmlValidation="false"
          xmlNamespaceAware="false">

          <Context path="" docBase="/opt/tomcat/webapps/railoweb/" />
       </Host>
  • Now its time to Restart the Tomcat and hit our application.

The sample application is available at railoweb.akbarsait.com. Hope this helps and share your experience about Jelastic Cloud and issues you come across while configuring applications.



Nathan Miller's Gravatar This link isn't working: http://railoweb.akbarsait.com/
# Posted By Nathan Miller | 2/9/12 11:25 AM
Akbarsait's Gravatar @Nathan It's working now please check.
# Posted By Akbarsait | 2/9/12 10:19 PM



About Me

ColdFusion Enthusiast, Web Developer and Consultant, Travel, Technology, Android, Xbox, Movies and Music Fan boy. more
Akbarsait's Blog RSS Feed Twitter Google Plus Facebook Twitter Facebook
        My WishList


  Chennai Adobe ColdFusion User Group    MySql Backup and FTP



  


Archives

Aggregated by

 Aggregated by ColdFusionBloggers
 Aggregated by MXNA
 Aggregated by CFBLOGS.COM