Today we’ll show you how to deploy ContentBox, a professional open source Modular CMS that allows you to easily build websites, blogs, wikis and complex web applications to the Jelastic Cloud. It’s built with a secure and flexible modular core, designed to scale, and provides world-class support. ContentBox is powered by Railo, an open source CFML engine that can be deployed to any Java Servlet Container. Moreover, you’ll see how to use its embedded Railo CFML cluster cache by the Memcached implementation and how it can help to create a fast and scalable caching layer for ContentBox.
In our case, the clustered cache offers shared session storage for all servers in a cluster. You can then store all the sessions in this cache that are available from all servers in the cluster. In other words, we’ll use Memcached for session replication. So let’s take an easy example.
Our cluster has 2 servers and every one of them holds the same application ContentBoxand connects to the same MySQL database. We use Memcached here to offer the opportunity to scale out huge amounts of memory to a server farm and store large amounts of data in it.
1. Log into your Jelastic account and click on the Create environment button.
2. Pick two TomEE instances, MySQL as the database you want to use and select Memcache node as your cache storage. Then specify the resource consumption for each node and enter the environment name.
In a few minutes you’ll see your environment on the dashboard.
1. Click Open in browser for MySQL database.
2. Jelastic will send you an email with credentials to the database. Use these credentials to create a user and the database with the application.
2. Upload the archive to the Jelastic Deployment Manager.
3. Deploy ContentBox to the Jelastic Cloud.
Change Railo CFML Default Passwords
We recommend that you change the default administrator passwords for the embedded Railo CFML engine.
1. Navigate to Railo CFML Server Admin using the following URL format http://mydomain.com/railo-context/admin/server.cfm and log in using the following password: contentbox.
2. Click on the Security > Password menu item on the left hand side
3. From this next screen you will be able to add a captcha to the login screen, change the administrator password and also set the default password for all web applications deployed to this server. We recommend changing the administrator password and the default password for all web administrators (Railo offers a server wide administrator and a web context administrator).
1. Enable session replication via Memcached as it’s described in this tutorial.
2. Navigate to Railo CFML Server Admin using the following URL format http://mydomain.com/railo-context/admin/server.cfm and log in using the following password you setup in the before steps. If you did not change it then the default password is: contentbox.
3. Navigate to the Applications tab from the left hand menu and install the Railo Memcached driver.
4. Navigate to the Cache tab and create a new cache connection from the Railo CFML server to Memcached.
5. Enter your Memcached node IP address and port number, which can be viewed by clicking the Info button for Memcached on the Jelastic dashboard. Set the flag Allow to use this cache as client/session storage, specify your connection settings and submit the connection creation.
6. Now that your cache connection is successfully created, verify it.
7. Go back to the Jelastic Dashboard and click the Config button for TomEE.
8. Navigate to Application.cfcfile from the deployed ContentBox application and add the following settings to distribute the sessions via Memcached:
9. Enable ContentBox to use the same cache for monitoring and content/RSS distribution. You will then be able to not only distribute your sessions across the cluster but also multiple levels of content caching and RSS feeds as well. To do this you will need to open the CacheBox.cfc file (webapps/ROOT/config/CacheBox.cfc) and add a new cache definition under the caches section:
1. Extract railo-inst.jar (contentbox-x.x.x.war/WEB-INF/railo/lib/railo-inst.jar) file from ContentBox WAR archive, which you downloaded earlier.
2. Upload this jar library to the home directory of TomEE.
3. Go to variables.conf file (server directory) and specify the path to railo-inst.jar according to the environment variables.
4. Save all the changes for both instances and restart your servers in order to apply the new settings.
1. Click the Open in browser button for your environment.
2. Specify your data source connection using your Railo CFML Administrator password, MySQL user and database, which you created earlier.
Note:The default CFML Application password iscontentbox if you did not change it in our previous steps.
3. Verify the entered data and confirm the data source creation. ContentBox will then prompt you for your ContentBox administrator user, site information, mail and rewrite settings.
Note: On the rewrites installation screen, choose ContentBox Express from the dropdown as ContentBox includes an embedded rewrite engine when deployed as a WAR.
4. The final step is to tell ContentBox to use Memcached for storing content and RSS feeds. Go to the System > Settings from the top menu in ContentBox and click on the Content Options tab on the left hand side. From here you will have a drop down that says Content Cache Provider, click on it and change it from “TEMPLATE” to “Memcached”.
5. You can then click on the RSS Options tab and do the same for generated RSS Feeds.
That’s all you have to do to get a highly available ContentBox cluster! You can distribute your sessions without J2EE management, distribute your managed content objects and your RSS feeds and all of them will be available for your entire cluster. Enjoy!