Installation of the Corinis CCM
This installation HowTo explains the layout and required steps to get Corinis up and running. It includes the installation instructions for the required software (java, etc.) and the corinis specific setup procedure.
This requires the Corinis core package 3.0.3 or greater to work.
Short overview
Following mothods are available:
- One App Install with zip (the quick way) - If you just want to try it out, or you do not have your own tomcat server running
- Multiple Application (the long way) - If you want complete control, for easy updating multiple applications
You can also choose if you want to use an external database (like mysql) or use the included hsqldb database.
REALLY Quick Way (windows only)
- Get and install the installer (setup.exe) from http://www.corinis.org/en/Download/
- Start tomcat either using the control-panel (under services) or with the tomcat manager included in the installation (check start-menu - all programs - corinis)
The installer installs a few examples with a tomcat and a mysql plus a prefilled database. It is still work in progress, so some things do not work yet. For the examples see the links in the start menu.
Quick Way (Windows and Linux)
- Download and install Apache Tomcat
- Download the corinis-X.Y.Z.zip
- Setup tomcat (see Setting Up Tomcat)
- Extract the zip in tomcat/web-apps/corinis
- run Tomcat and go to http://localhost:8080/corinis/
Multiple Applications
Every application needs it's own corinis.xml - it is located in the WEB-INF directory of the web application.
Because of this you dont have to change anything in you application in order for handling multiple application on one server, just make sure you use the correct paths in the corinis.xml (or use auto), and that each applicaiton has its own database.
Just make sure you create either a symlink or copy the administration pages in the web directory in order to be able to access the adminsitration pages from each applicaiton. Also make sure tomcat has write rights in the WEB-INF/log, WEB-INF/cache, cmsfiles and photofiles directories of the webroot (some directories may differ based on your corinis.xml)
Core core = new Core (pageContext);
Long way (Install everything by scratch)
- Java jdk > 1.4. (Sun's Java or Blackdown Java)
- a servlet container (Apache Tomcat, or other)
Optional:
Basic Installation
Windows
- get the Java 2 SE SDK from http://java.sun.com/j2se/1.4.2/download.html and install it (JDK 1.5 is supported, 1.6 not yet fully)
- get Apache Tomcat (a non-alpha version would be best) from http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi and install it
Start the Apache Tomcat and use your favorite webbrowser to test if it is running on http://localhost:8080/ if not consult http://jakarta.apache.org/tomcat/faq/windows.html
A common problem is, that tomcat cant find java. This can easily be avoided if you check your environmental variables after installing java. For this you can either open a commandline and use set and check for a JAVA_HOME= line (should point to the j2sdk installation directory).
The other way to find out if the variable exists (and also to set it) is to open the control panel, go to sytem then open the advanced tab and click on environmental variables. You can theen add/change and check if the JAVA_HOME variable exists and points to the correct path.
Linux RPM based
Use your package manager and install mysql, java and tomcat. You can also look at
- get the Java 2 SE SDK from http://java.sun.com/j2se/1.4.2/download.html
- get Apache Tomcat (a non-alpha version would be best) from http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi
for rpm versions.
Linux Debian based
As root do:
apt-get install tomcat/unstable #optional for apache you can also install apt-get install libapache-mod-jk apache
Also make sure to check out http://www.halfcooked.com/mt/archives/000822.html
Linux Gentoo
As root do:
# apache is optional emerge apache emerge jikes USE="jikes" emerge tomcat # start everything at boot time rc-update add apache2 default rc-update add tomcat default rc-update add mysql default
Libraries for Corinis
Before going on, please make sure your tomcat installation works. Start tomcat and try to browse on http://localhost:8080 - you should see a default tomcat page, if not consult the tomcat documentation or the forums/mailing lists!!'''
In the current corinis-x.y.z.zip (startwing with 3.0.5) the libraries are already included, you do not have to download them seperately! The only thing you should setup is imagemagick for better image manipulation support''
Corinis is based on a number of external libraries. All libraries should be installed in tomcatroot/common/lib . Make sure you know where your tomcatroot is, you will need it quite often :)
After downloading the packages (most of the time zip or tar.gz), get the jar file out of it and put it in tomcatroot/common/lib.
- Apache Commons IO: http://jakarta.apache.org/site/binindex.cgi#commons-io (commons-io-1.1.jar)
- Apache Commons fileupload: http://jakarta.apache.org/site/binindex.cgi#commons-fileupload (commons-fileupload.jar)
- MySQL Connector: http://dev.mysql.com/downloads/connector/j/ (mysql-connector-java-3.x.y-bin.jar) - or MaxDB or Oracle JDBC Connector
- Java Activation: http://java.sun.com/products/javabeans/glasgow/jaf.html (activation.jar)
- Java Mail: http://java.sun.com/products/javamail/javamail-1_3_1.html (mail.jar)
- Jimi: http://java.sun.com/products/jimi/ (jimi.jar)
- PDFBox: http://www.pdfbox.org/ (PDFBox-x.y.z.jar)
- xml-commons: http://xml.apache.org/mirrors.cgi (xml-apis.jar)
- xerces: http://xml.apache.org/xerces2-j/download.cgi (xercesImpl.jar)
- jcifs: http://jcifs.samba.org/ (jcifs-1.x.y.jar) -> this is needed by the login classes
- exif library: http://www.drewnoakes.com/code/exif/releases/metadata-extractor-2.4.0-beta-1.jar (use latest)
Installing libraries - Gentoo Way
Getting the libraries manually or by any package management system is no big difference. The files will be the same, only that when using portage, you can update them more easily.
In gentoo you can get following libraries from portage (you dont have to download them):
- commons-io
- commons-fileupload
- jcifs
- xerces
- xml-apis
- javamail (sun)
You still need to manually get:
- pdfbox
- activation
# get jimi as described by emerge sun-jimi # get javamail as described by emerge sun-javamail-bin # also get the sun activation classes (activation.jar) and put them in the /usr/share/tomcat-5/common-lib # this will also install jdbc2-stdext-2.0 and jta also with fetch restrictions emerge jdbc-mysql emerge commons-io commons-fileupload jcifs imagemagick cd /usr/share/tomcat-5/common/lib ln -s /usr/share/sun-jaf-bin/lib/activation.jar activation.jar ln -s /usr/share/commons-io-1/lib/commons-io.jar commons-io.jar ln -s /usr/share/commons-fileupload/lib/commons-fileupload.jar commons-fileupload.jar ln -s /usr/share/xerces-2/lib/xercesImpl.jar xercesImpl.jar ln -s /usr/share/xml-commons/lib/xml-apis.jar xml-apis.jar ln -s /usr/share/sun-javamail-bin/lib/mail.jar mail.jar ln -s /usr/share/sun-jimi/lib/sun-jimi.jar sun-jimi.jar ln -s /usr/share/jcifs-1.1/lib/jcifs.jar jcifs.jar ln -s /usr/share/jdbc-mysql/lib/jdbc-mysql.jar jdbc-mysql.jar
Setting up tomcat
You might want to tweak the tomcat setup. If you have only one application on your machine (no virtual hosts) the easiest way to get it up and running is to change the default !appBase. Open your server.xml (found in tomcat/conf/server.xml) and change the lines:
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
to
<Host name="localhost" debug="0" appBase="c:\\myapp\\webroot" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="" debug="0"/>
If you want virtual hosts you can add this just after the </Host>:
<!-- www.mydomain.tld --> <Host name="www.mydomain.tld" debug="0" appBase="/home/myhome/mydomain/webroot" autoDeploy="true"> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="mydomain_log." suffix=".txt" timestamp="true"/> <Context path="" docBase="" debug="0"/> </Host>
Make sure the webroot directory is writeable by tomcat, so it can setup the applicatin for you.
you should put a test.jsp in your webroot to see if everything is all right.
<%=2+2%>
If you open your browser to http://localhost:8080/test.jsp (or whatever you host is) then you should see a 4 on the screen. If not check your configuration and do not forget to restart tomcat!
Status 500 on the first run
It may be that the following error shows on your browser:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:83) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:315) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:406) org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
In this case just copy the tools.jar from your jdk in the tomcat/common/lib directory (as described in the error message :P ) Do not forget to restart the server after copying.
Setting up Corinis (single app installation/war)
The directories
Corinis needs following directories:
- the webroot (with the administration pages)
- an xsl directory (for all xsl-stylesheets)
- a template directory (for the cms templates)
- a web-accessible filelib directory (for uploaded images etc.)
Make sure you created all of them and set the rights so tomcat can read AND write there.
Example tree
home/C:
|- myapp
|- webroot (web directory http://localhost:8080/)
|- admin (administration pages http://localhost:8080/admin/)
|- filelib (files and images http://localhost:8080/filelib/)
|- pictures (for photolibrary)
|- WEB-INF
|- lib (put your corinis .jars in there)
|- xsl (xsl directory)
| |- admin (administraion xsl)
|- templates (cms templates)
|- lib (put the corinis and the additional jars in there)
|- corinis.xml (all configuration for this application)
If you download and extract the war version, your directory layout will look exactly like this except that instead of the .jar files you will find the corinis classes in the classes directory. If you switch to the jar files delete all directories from the classes dir (except corinis.xml) and put your jars in the lib directory.
When installing template packages they will also write in these directories.
Getting the packages
Get the corinis-X.Y.Z.war from http://www.corinis.org/en/Download/ and extract in in your webroot. You should then have a directory layout like in the previous step.
You can also get the jars. But for your first setup stick to the war. It's much easier this way.
Installation
Now start your tomcat server and go to http://localhost/install.jsp . Fill in/fix all fields. When the install.jsp tells you to restart your context/server do so! Same goes for the database creation'''
You should be done after setup has run.
Advanced Setup
If you want more control over whats going on or multipe applications without always having to update all directories, follow this guide.
Instead of the war file get the jar/zip files from http://www.corinis.org/en/Download
Download the .jar and put them either in your tomcat/common/lib/. You have to restart tomcat after doing this. Otherwise the packages are not available.
You then need to setup your administration pages. In order to do this you have to copy the .zip files (containing the administration) in a "install directory" (That is a directory you will set using the installer. Put your template and module .zips there so the packager will find it).
The last manual step is to get the install.jsp (rightlick->save as->install.jsp) and put it in your webdirectory.
Open a webbrowser and open http://localhost:8080/webapp/install.jsp.
From now on follow the instructions on screen, to set up a basic environment. Make sure your database is setup and you have a user to access it.
You can then log in into the administration pages by using http://localhost:8080/corinis/ with the user admin, the selected password (default admin) and your application (default: corinis).
