Installing dotCMS 1.9 In the Cloud

As some of you already know, ETHODE has chosen dotCMS 1.9 for their next CMS build out. I have a couple post prior explaining why but this post will focus on getting the system setup using Storm On Demand (Cloud, not Baremetal Servers) which is a service from LiquidWeb.

Server Packages & Setup

Step 1) Setup Server

For me, like stated, I am using Storm On Demand servers, thus I basically login to my control panel and I create a new instance. This server takes just a couple minutes to build and then I'm ready to go.  The password is set to the account strong password used when creating your control panel login.  So you can ssh into your machine using that password and the root username.

The first thing I always like to do with a new instance is run a full system update using APT.

apt-get update

Step 1-a) Java JDK

Then once everything is update install the 1.5 jdk (now all number is single, so look for JDK for J2SE 5, instead of 1.5, which is need for dotCMS to run (not compatible with 1.6).  You can use the IBM, Sun or openJDK version.  Doesn't make a difference, but Ubuntu allows you to use openJDK and Sun's JDK right from APT.

apt-get install sun-java5-jdk

Once the jdk is installed you're almost ready to go.

Now make sure that the JAVA_HOME path is set.  You can try the command "export $JAVA_HOME" and if nothing comes out, then you'll need to set it.

One way that you can set your JAVA_HOME variable and add to your PATH, is be doing the folowing.  As 'sudo' open up /etc/bash.bashrc and add the following to the end of the file.  NOTE: Set the java path to whatever the actual path is on your environment if it does not match /usr/lib/jvm/java
JAVA_HOME=/usr/lib/jvm/java
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

Next, save the file and in some cases you might have to restart your sshd daemon.

/etc/init.d/sshd restart

Step 1-b) MySQL

Make sure MySQL is installed.  You can simple try "/etc/init.d/mysql restart" to see if the server exists.. Yes yes I know some of you are already yelling at me to just use the version check command.. But, sometimes, this command just slips off of the fingers quicker haha.  I do a lot of restarting of daemons, it's like second nature, and besides this is a new server install, there isn't anything live using MySQL yet.  If this server wasn't a new instance, please be aware this is dumb, and shouldn't be used.

Just in case you don't have MySQL installed, you can use the follow APT command

apt-get install mysql-server

After you have ensured that MySQL is running we need to change 1 setting in the my.cnf file.

vim /etc/mysql/my.cnf

Add "lower_case_table_names=1" excluding the quotes to the my.cnf file and then run the MySQL restart command again and MySQL is ready to go.  We do not need to run any install scripts on MySQL because the dotCMS package is set to install it's data into the database when it's ran for the first time.

Lastly, lets create a database and user for dotcms.  So lets login to MySQL.

mysql --user=username -p
mysql> create database dotcms; (now hit enter)
mysq> use dotcms; (hit enter)
mysql> create user 'dotcms'@'localhost' IDENTIFIED BY 'somePassWord' (hit enter)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'dotcms''@'localhost' (hit enter)

optionally if you would like to access the db outside of the localhost using the same user you can interchange 'localhost' with '%'.

Now you have created a new user, and granted it permissions on the dotcms database. MySQL is ready to rock baby!

Step 2) Get dotCMS 1.9

I learned the hard way but as tantalizing as the full fledged release version of dotCMS 1.9 is, please use the latest trunk from svn.  There are a HUGE number of bug fixes, and I underestimated just how many.  I previously installed 1.9 from the version 1.9b3, and there were some CRUCIAL bugs still now fixed like the ability to add multiple hosts, and copy hosts.. This a HUGE issue.  However, the latest trunk is all good to go.

Step 2 a) Download dotCMS 1.9 from SVN

No matter what SVN client you use there are many out there. No matter which client you use get the latest version from http://svn.dotcms.org/trunk

Step 2 b) compile dotCMS using ant

Once the source has downloaded you'll have to compile it, and it will created all of the necessary SQL files and trust me it's not hard..  Just 1 command, your grandmother could do this :-)

The command you need to run (windows or ssh) is going to be from the root of the project and is:

ant deploy

I know, confusing huh? ;) At any rate this will setup the entire directory, files, etc to be installed.

Step 2 b) Place files in location for instance

Now, you can technically run the instance from where ever you would like but I like to keep things tight in Ubuntu.  I suggest putting the files into a directory called "dotCMS", or perhaps "dotCMS19" and that directory should be located in /user/local and some like to use /opt/ in Ubuntu.. Doesn't matter much to me but I don't like to run these things from my user or root home folders.

Step 3 a) Configure dotCMS

We have a couple things we need to take care of.  First we need to edit /conf/Catalina/localhost/ROOT.xml file. Make sure and change the database name in the URL, the username and password for the database server and make sure that only ONE database config is uncommented at a  time.. Trust me, people forget about this all the time.

From the root directory, (dotCMS/) run the following command:

chmod -R 755 *.sh

This will ensure that all sh scripts have the correct permission both in dotCMS and tomcat to run properly.

Step 4) Start the dotCMS instance

Go into your dotCMS installation directory.. dotCMS/bin/ and run the following to start the installed and cause dotCMS to install the default database scripts.

sh ./startup.sh

Step 5) Login and Enjoy

You're all set, now just login to http://localhost/c/

Say Hello

Near the Cleveland, Akron or Medina area and want to stop by our office? Let us know and we'll get the coffee and whiteboards ready. :)