User Tools

Site Tools


work:dotcms

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
work:dotcms [2012/09/20 21:01] alunwork:dotcms [2013/01/10 09:46] (current) alun
Line 1: Line 1:
 +====== dotCMS ======
 +
 +===== Build =====
 +
 +Trying a build on work PC VM (Centos 6.2). I suspect this won't have the grunt to run dotCMS - but will give it a go...
 +
 +Cloned existing VM (as Springboard needed a downgraded 5.0 mysql database - dotCMS needs at least 5.1 which is the standard for CentOS6).
 +
 +<code>
 +$ sudo service mysql stop
 +$ sudo yum remove MySQL-client MySQL-server MySQL-shared
 +...
 +$ sudo yum install mysql-server
 +...
 +$ sudo yum list mysql*
 +...
 +Installed Packages
 +mysql.i686                                                          5.1.61-4.el6                                               @base
 +mysql-libs.i686                                                     5.1.61-4.el6                                               @base
 +mysql-server.i686                                                   5.1.61-4.el6                                               @base
 +...
 +
 +$ sudo chkconfig mysqld on
 +$ sudo chkconfig --list|grep mysqld
 +mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
 +$ sudo service mysqld start
 +...
 +$ /usr/bin/mysql_secure_installation
 +...
 +$ sudo /usr/bin/mysql_upgrade -u root -p
 +...
 +</code>
 +
 +(Probably did not need to run mysql_secure_installation, as database details were already set-up from the 5.0 install - but ran upgrade and then deleted any non-system databases.)
 +
 +Increased VM memory to 2GB, and downloaded ZIP file:
 +
 +<code>
 +$ mkdir dotcms
 +$ cd dotcms/
 +$ unzip ~/Downloads/dotcms_2.1.1.zip
 +...
 +
 +$ mysql -u root -p
 +...
 +mysql> create database dotcms default character set = utf8 default collate = utf8_general_ci;
 +...
 +mysql> grant all privileges on dotcms.* to "dotcms-user"@"%" identified by "password";
 +...
 +mysql> grant select on mysql.proc to "dotcms-user"@"%";
 +...
 +mysql> flush privileges;
 +...
 +</code>
 +
 +Need to edit the database properties - in dotcms/dotserver/tomcat/conf/Catalina/localhost/ROOT.xml
 +
 +<code>
 +$ vi dotcms/dotserver/tomcat/conf/Catalina/localhost/ROOT.xml
 +...
 +        <!-- MYSQL UTF8 -->
 +        <Resource name="jdbc/dotCMSPool" auth="Container"
 +                  type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"
 +                  url="jdbc:mysql://localhost/dotcms?characterEncoding=UTF-8"
 +                  username="dotcms-user" password="password" maxActive="60" maxIdle="10" maxWait="60000"
 +                  removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
 +                  validationQuery="SELECT 1" testOnBorrow="true"/>
 +...
 +</code>
 +
 +Edit the server settings (host/port) - defaults to localhost, port 80:
 +
 +<code>
 +$ vi dotcms/dotserver/tomcat/conf/server.xml
 +...
 +    <Connector maxThreads="75" connectionTimeout="3000" port="8000" protocol="HTTP/1.1" redirectPort="8443"/>
 +...
 +</code>
 +
 +Update script permissions:
 +
 +<code>
 +$ chmod 755 dotcms/dotserver/bin/*.sh
 +$ chmod 755 dotcms/dotserver/tomcat/bin/*.sh
 +</code>
 +
 +Start-up...
 +
 +(NOTE: On a re-configured VM make sure that you don't have a rogue $CATALINA_HOME setting - as I did - I've set this up now with $JAVA_HOME set, but no $CATALINA_HOME)
 +
 +<code>
 +$ cd dotcms/dotserver/
 +$ ./bin/startup.sh
 +$ less tomcat/logs/dotcms.log
 +...
 +</code>
 +
 +Up and running...
 +
 +===== WebDav =====
 +
 +On Centos6 install devfs2:
 +
 +<code>
 +$ sudo yum install davfs2
 +...
 +
 +$ sudo mkdir /dav
 +$ sudo mount -t davfs http://localhost:8000/webdav/autopub/ /dav
 +Please enter the username to authenticate with server
 +http://localhost:8000/webdav/autopub/ or hit enter for none.
 +  Username: [email protected]
 +Please enter the password to authenticate user [email protected] with server
 +http://localhost:8000/webdav/autopub/ or hit enter for none.
 +  Password:
 +
 +</code>
 +
 +This makes files available on Centos filesystem:
 +
 +<code>
 +$ ls -l /dav/
 +total 0
 +drwxr-xr-x 15 root root 0 Apr 25 10:05 demo.dotcms.com
 +drwx------  2 root root 0 Sep 27 10:07 lost+found
 +drwxr-xr-x 12 root root 0 Jun 21 16:53 m.demo.dotcms.com
 +drwxr-xr-x  3 root root 0 Feb 29  2012 shared
 +drwxr-xr-x  2 root root 0 Sep 27 10:09 system
 +</code>
 +
 +
 +===== Build on Home Laptop =====
 +
 +**N.B. dotCMS 2.1.1 doesn't start up on 64-bit Linux, apparently a 'data' issue that should be resolved in 2.2. Also, dotCMS won't currently build in Java 7 - must use Java 6**
 +
 +Started with standard Centos 6.3 netinstall...
 +
 +[[linux:centos6netinstall#core_install]]
 +
 +Used default (minimal) installation. 
 +
 +Will need Java 6, MySQL 5.1, and dotCMS software...
 +
 +<code>
 +# yum update
 +...
 +
 +# yum install mysql-server
 +...
 +# chkconfig mysqld on
 +# service mysqld start
 +...
 +# /usr/bin/mysql_secure_installation
 +
 +
 +# cd /srv/
 +# tar -zxf ~/jdk-7u7-linux-x64.gz
 +# ln -s /srv/jdk1.7.0_07/ /srv/java
 +# ls -l
 +lrwxrwxrwx. 1 root root   17 Sep 19 23:01 java -> /srv/jdk1.7.0_07/
 +drwxr-xr-x. 8 root root 4096 Aug 29 02:12 jdk1.7.0_07
 +
 +</code>
 +
 +Added non-root account, and define Java home an path:
 +
 +<code>
 +# useradd dotcms
 +# passwd dotcms
 +...
 +
 +# su - dotcms
 +$ vi ~/.bash_profile
 +...
 +export JAVA_HOME=/srv/java
 +export PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
 +
 +</code>
 +
 +Now unpack the dotCMS package (had to install unzip too!):
 +
 +<code>
 +# yum install unzip
 +...
 +$ mkdir dotcms
 +$ cd dotcms
 +$ unzip ../dotcms_2.1.1.zip
 +...
 +
 +</code>
 +
 +Create database, and user:
 +
 +<code>
 +$ mysql -u root -p
 +...
 +mysql> create database dotcms default character set = utf8 default collate = utf8_general_ci;
 +...
 +mysql> grant all privileges on dotcms.* to "dotcms-user"@"%" identified by "password";
 +...
 +mysql> grant select on mysql.proc to "dotcms-user"@"%";
 +...
 +mysql> flush privileges;
 +...
 +</code>
 +
 +Configure the database properties...
 +
 +<code>
 +$ vi ~/dotcms/dotserver/tomcat/conf/Catalina/localhost/ROOT.xml
 +...
 +        <!-- MYSQL UTF8 -->
 +        <Resource name="jdbc/dotCMSPool" auth="Container"
 +                  type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"
 +                  url="jdbc:mysql://localhost/dotcms?characterEncoding=UTF-8"
 +                  username="dotcms" password="password" maxActive="60" maxIdle="10" maxWait="60000"
 +                  removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
 +                  validationQuery="SELECT 1" testOnBorrow="true"/>
 +...
 +</code>
 +
 +Edit the server settings (host/port) - defaults to localhost, port 80:
 +
 +<code>
 +$ vi ~/dotcms/dotserver/tomcat/conf/server.xml
 +...
 +    <Connector maxThreads="75" connectionTimeout="3000" port="8000" protocol="HTTP/1.1" redirectPort="8443"/>
 +...
 +</code>
 +
 +Update script permissions:
 +
 +<code>
 +$ chmod 755 ~/dotcms/dotserver/bin/*.sh
 +$ chmod 755 ~/dotcms/dotserver/tomcat/bin/*.sh
 +</code>
 +
 +Start-up...
 +
 +<code>
 +$ cd ~/dotcms/dotserver/
 +$ ./bin/startup.sh
 +$ less tomcat/logs/dotcms.log
 +...
 +</code>
 +
 +
 +===== Resources =====
 +
 +Documentation: http://dotcms.com/docs/2.0/TableOfContents
 +
 +Architecture Overview: {{:work:dotcms-architecture.pdf|}}
 +
 +
 +===== Site Building =====
 +
 +So how do we build and deploy sites?
 +
 +Have started creating a copy of the Significance website. 
 +
 +Started by creating a copy of the magazine article section page as a dotCMS template (everything in one template), then getting all the assets (images, CSS, javascript) and loading then into dotCMS via webdav.
 +
 +>I've had issues with the WebDAV, though it is now working. I can't help thinking this is rather flaky - but there you are.
 +
 +From this starting point I have started to separate out the parts of this page into Springboard like blocks, using dotCMS containers.
 +
 +>How can we move templates from one site to another, or one dotCMS instance to another?
 +
 +>How can we control access to site editors, to only allow them access to edit 'editable' content?
 +
 +>The use of containers in templates is hard-coded - not re-using templates as in Springboard. How would we organise sites in dotCMS?
 +
 +Next I want to create a magazine article listing...
 +
 +...also work out how to export/import these (non-WebDAV accessible) assets...
 +
 +
 +===== gitflow on Centos =====
 +
 +<code>
 +$ curl -LO http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
 +...
 +
 +$ sudo vi /etc/yum.repos.d/epel.repo
 +[epel]
 +name=Extra Packages for Enterprise Linux 6 - $basearch
 +#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
 +mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
 +failovermethod=priority
 +enabled=0
 +gpgcheck=1
 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 +...
 +
 +$ sudo yum --enablerepo=epel install gitflow
 +...
 +
 +
 +</code>
 +
 +=== Licence Key ===
 +
 +The licence file I have moved and preserved on my dotCMS instances is found here: 
 +
 +  dotCMS/dotCMS/assets/license/license.dat
 +
 +(The license folder doesn’t exist if there’s no licence key.) This will be preserved if all instance assets are copied from one server to another – and I assume the key will work on any instance.
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki