Technical FAQ
Jahia 3.1 FAQ
- How can I configure a connection to a LDAP server ?
- How can I change the amount of log generated by Jahia ?
- How can I change the HTTP port Jahia runs on ?
- How can I improve database accesses ?
- How can I improve Jahia performance ?
- How can I package new templates and deploy them in Jahia ?
- How can I proceed to a "low-level" upgrade ?
- I'm continiously loosing my session when I'm logged. Why ?
- What is the duration of a session and how can I change it ?
- I've got a "Hey where is the licence file" message in the console of Jahia. What does that mean ?
- What is the jahia.properties file ?
- Why do I have a message "Out of environment space" when running Jahia under Windows 95/98/Me ?
- I'm using JDK 1.4.x and Jahia produce errors when running. Why is that so ?
- I've switched to the last version of Tomcat and now Jahia produce errors. Why ?
- I've got an "JAVA_HOME variable is not set" message when trying to launch the Jahia install. Why ?
- I want to run Jahia under another application server. What servers are supported ?
- I've tried several things but it is impossible to run Jahia. What can I do ?
Jahia 3.1 FAQ
-
How can I configure a connection to a LDAP server ?
Basically you have to configure the connection to LDAP server through two files :
jahiaedition3/tomcat/webapps/jahia/WEB-INF/etc/services/usermanager/router-config.xml
which by default has some commented out lines for LDAP support. Remove the comments to activate the loading of the LDAP backend service as well as the comments to activate the LDAP criteria. You should uncomment the paragraph beginning with <provider><key>ldap</key> as well as the <criteria> part.
The second file which should be modified is:
jahiaedition3/tomcat/webapps/jahia/WEB-INF/etc/ldap/users.ldap.properties
It contains mapping to the LDAP schema. This file contains the configuration of the connection to the LDAP server, as well as mapping from LDAP attributes to Jahia user attributes, and also various configuration options for the LDAP backend. Change the users.ldap.url attribute to match the address and port of the LDAP server you are trying to access, as well as the mapping to your LDAP schema.
Right now Jahia only support a LDAP connection in a non authenticated environment. It means that if your LDAP server requires you to log in, you won't be able to use LDAP connection.
-
How can I change the amount of log generated by Jahia ?
The configuration of the logging sub-system depends on the version of Jahia.
Jahia 4 :
---------
This version of Jahia uses Log4J (http://jakarta.apache.org/log4j) as a logging system, and it's configuration file is located here :
jahiaXXX_XXXX/tomcat/webapps/jahia/WEB-INF/etc/config/log4j.xml
Log4J has a powerful configuration system, but usually the most common setting to change is located at the bottom of the file :
<root> <priority value="error"/> <appender-ref ref="STDOUT"/> <!-- <appender-ref ref="Chainsaw"/> --> </root>
Basically you'll want to change the "priority" setting. Possible values are (in ascending order of importance) :
- debug : the most detailed level. Will print out LOTS of debugging information on the inner workings of Jahia. Great to figure out the real cause of a problem.
- info : informational messages, that do not reflect errors but are just general information messages
- warn : warning level. This often indicates some misconfiguration or some errors that will not disturb other sub-systems.
- error : this level will display important error messages, usually along with stack traces. These messages should *not* be happening, and if generated should be taken care of as soon as possible
- fatal : messages that indicate that Jahia can no longer run, because some fatal condition has been reached. An example of a fatal condition would be a trial license expiration.
Jahia 3 :
---------
Final releases of Jahia are configured to generate minimal amount of log. In case you have problems runnning Jahia, it may be useful to change the log level to have detailed output of the error in the Jahia console. For this you need to change the following file:
jahiaedition3/tomcat/webapps/jahia/WEB-INF/web.xml
Change the value of the parameter
logging_level
from 0 to 10. Restart Jahia. You will see in the Jahia console that you have much more detailed information displayed when launching and running Jahia.
-
How can I change the HTTP port Jahia runs on ?
By default, Jahia comes with Tomcat configured to run on server port 8080, as some machine may already have a web server running on standard HTTP port 80.
To change the HTTP port of tomcat, open the following file :
tomcat/conf/server.xml
Around line 55 in the section identified by "Define a non-SSL HTTP/1.1 Connector", you will find the following definition:
<connector classname="org.apache.catalina.connector.http.HttpConnector"
port="8080" minProcessors="5" maxProcessors="75" enableLookups="true"
redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="60000"/>
Replace the port parameter with wichever port you want to run Jahia on.
If you don't want Tomcat to proceed to reverse lookups (in case you
are behind a firewall which filter these requests), set the
enableLookups parameter to "false".
Modify also in the URL's section of the jahia.properties file (in tomcat/webapps/jahia/WEB-INF/etc/config/ ) around line 45 the following parameter:
jahiaWebAppsDeployerBaseURL = http\://localhost\:8080
and replace 8080 by the choosen port.
Please note that when restarting Jahia, launch script will still try to access Jahia on port 8080, so open a browser and enter the url to access Jahia. For example, if you set Tomcat to run on port 80, the correct URL would be:
http://localhost/jahia/Jahia
You can also modify the bin/jahia.bat or bin/jahia.sh script to change the port that is used during startup. You will also have to change the following HTML files :
tomcat/webapps/jahia/html/startup/launch_jahia.html
tomcat/webapps/jahia/html/startup/launch_admin.html
Check the following page regarding dynamic URL rewriting:
www.jahia.org/jahia/page360.html
-
How can I improve database accesses ?
As Jahia is supporting many databases, there is no specific tunning made to optimize database performance. However, with the use of database indexes, you can gain a significative amount of performance, especially in the case of large Jahia site with many pages and containers.
Here is a list of key fields in tables where indexing will make a difference:
jahia_acl
- id_jahia_acl
- parent_id_jahia_acl
jahia_fields_data
- id_jahia_fields_data
- ctnid_jahia_fields_data
- pageid_jahia_fields_data
jahia_ctn_entries
- id_jahia_ctn_entries
- pageid_jahia_ctn_entries
jahia_pages_data
- id_jahia_pages_data
- parentid_jahia_pages_data
jahia_ctn_lists
- id_jahia_ctn_lists
- pa geid_jahia_ctn_lists
As an example, to set up an index on the field id_jahia_acl in table jahia_acl for
PostgreSQL, the following command would be used:
- CREATE INDEX id_jahia_acl_index ON jahia_acl (id_jahia_acl);
Please refer to your database documentation for procedures to set up indexes.
-
How can I improve Jahia performance ?
Jahia is also dependant on the underlying layers to give you optimum performances. Some of these layers can be replaced to produce better results. We have tested 2 options that can greatly improve Jahia performance :
- IBM JDK: The Java virtual machine developed by IBM produce significant improvement over Sun's. You can check the Volano report (http://www.volano.com/report) for details and performance benchmarks of various Java virtual machine. The IBM JDK is available for Linux and Windows.
Just download the IBM JDK 1.3.x (http://alphaworks.ibm.com/nav/Java?open&c=Java+-+Developer+Kits) and install it on your system. Then change the JAVA_HOME environnement variable to point the the directory where the IBM JDK is installed. Jahia will now use the IBM Java virtual machine to run.
- Jikes: Jikes is a compiler that translates Java source files into the bytecoded instruction set and binary format. It can be used in Jahia to compile .jsp files the first time they are called. Jsp compilation with Jikes is about twice as fast than the standard Java compiler.
Download Jikes 1.15 or better (http://oss.software.ibm.com/developerworks/opensource/jikes/) and decompress it on your system. You will need to modify 2 files in order for Jahia to use it:
catalina.sh (linux) or catalina.bat (windows) (in jahiaedition3/tomcat/bin/):
around line 73 (98 for linux), change the following line:
set CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
(windows)
CP="$CATALINA_HOME/bin/bootstrap.jar"
(linux)
to
set CP=%JAVA_HOME%\jre\lib\rt.jar;%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
(windows)
CP="$JAVA_HOME/jre/lib/rt.jar:$CATALINA_HOME/bin/bootstrap.jar"
(linux)
web.xml (in jahiaedition3/tomcat/conf/)
around line 130 change the following block:
jsp
org.apache.jasper.servlet.JspServlet
logVerbosityLevel
WARNING
3
to
jsp
org.apache.jasper.servlet.JspServlet
logVerbosityLevel
WARNING
jspCompilerPlugin
org.apache.jasper.compiler.JikesJavaCompiler
3
You will also need to add the path to where you decompressed Jikes (i.e. c:/java/jikes-1.15 for Windows) in the PATH environnement variable of your system.
Jahia will now use Jikes to compile .jsp files.
-
How can I package new templates and deploy them in Jahia ?
To build a .jar template package once you have created a set of templates, you will need to create a templates.xml file with the following format (taken from the white_templates package):
<?xml version="1.0" encoding="ISO-8859-1"?> <tpml> <parameter name="package-name">White Templates (fixed size)</parameter> <parameter name="root-folder">white_templates</parameter> <parameter name="provider">http://www.jahia.com</parameter> <parameter name="thumbnail">white_templates.gif</parameter> <template browsable="1" visible="1" homepage="1"> <parameter name="name">White Home</parameter> <parameter name="filename">home.jsp</parameter> <parameter name="display-name">White Home</parameter> </template> <br/><br/><template browsable="1" visible="1"> <parameter name="name">White One Column</parameter> <parameter name="filename">one_column.jsp</parameter> <parameter name="display-name">White One Column</parameter> </template>
The global parameters include:
- package-name : Name of the package as it will appear in Jahia.
- provider : Name or website of the provider of the set of templates
- thumbnail : a screenshot of the templates look can be used. It will be displayed on the list of available template sets when you create a new virtual site.
Attributes of the value include:
- browsable : Set to 1 if the template is listed when a user wants to add a new page.
- visible : Set to 1 if the template is listed when a user wants to add a new page. Set to 0 if the template should not be visible.
- homepage : If the template should be used for the home page of the site, add the homepage="1" value.
Parameters for each template are:
- name : The choosen name of the templae
- filename : the name of the jsp file
- display-name : The name of the template as it will appear in the templates list.
You can check the corporate_portal_templates.jar to see how it is constructed. It is located in:
jahiaedition3/tomcat/webapps/jahia/WEB-INF/var/shared_templates/
Once you have created your package, you can copy it in the following directory:
jahiaedition3/tomcat/webapps/jahia/WEB-INF/var/shared_templates/
When a new virtual site is created, your new template set will appear in the list of available sets. If you want to deploy the templates in you current virtual site, just copy the package to the following directory:
jahiaedition3/tomcat/webapps/jahia/WEB-INF/var/new_templates/current_site/
After a few seconds, the templates will be deployed and available.
-
How can I proceed to a "low-level" upgrade ?
As there is no specific tool to upgrade a site from a old version to a new one, the recommended way of upgrading is to use the extract/deploy feature of Jahia to extract all data from one Jahia server and to deploy them in a new version of Jahia.
In case this procedure failed, you can go the hard way and proceed to a low level transfer, which basically consists of moving all data from one Jahia to another.
The following procedure is valid for an upgrade from version 3.0 of Jahia to a 3.x:
- Shutdown Jahia.
- Install a new version of Jahia in a different directory.
- Copy the database (do not use the same database but make a copy of it, as you may want to go back to the old version in case the upgrade is not successful). -- Check your database documentation for information on how to copy a database.
- Copy all the installed webapps (located in jahiaedition3/tomcat/webapps/ ) to the same location in the new version of Jahia.
- Copy the jahiaedition3/tomcat/webapps/jahia/jsp/jahia/templates/my_web_site directory from the old installation to the new one. If you have multiple virtual sites, copy templates for all sites.
- Copy the jahia.properties file (located in jahiaedition3/tomcat/webapps/jahia/WEB-INF/etc/config/) from the old installation to the new one. Change the database part of the file to point to the copy of the database (i.e. jahia31_db vs jahia30_db)
- Copy the jahiaedition3/tomcat/webapps/jahia/WEB-INF/var/content/filemanager directory from the old installation to the new one.
- Copy the jahiaedition3/tomcat/webapps/jahia/WEB-INF/var/content/bigtext directory from the old installation to the new one.
-
I'm continiously loosing my session when I'm logged. Why ?
The following things could prevent Jahia from correctly storing and keeping sessions:
- cookies disabled:
Jahia use cookies to store users sessions. Please enable cookies in you browser
- "personal firewall":
Softwares like ZoneAlarm or Norton Internet Security, which are supposed to protects you against viruses and hackers, are also very restrictive when accessing web sites and can block cookies or prevent access when Jahia is running on non-usual ports (like 8080). Please disable these softwares and try again.
- URL:
Make sure that you always use the SAME url to access Jahia. For example do not mix URLs alias like this :
http://localhost:8080/jahia/Jahia
http://127.0.0.1:8080/jahia/Jahia
http://machinename:8080/jahia/Jahia
This is known to cause some trouble and we will be releasing new URL generation code with the final release of Jahia 3.1.
-
What is the duration of a session and how can I change it ?
By default, Tomcat is configured to end the session automatically if there is no activity on the server for 30 minutes. It means that if a user is editing a text in a window for more than 30 minutes without clicking on Apply or on any other field name in a container, he will loose his session and won't be able to submit the edited text.
You can change the default session timeout in the following file:
jahiaedition3/tomcat/conf/web.xml
Around line 288, in the "Default session configuartion" section, change the value of the
30
to whichever value (in minutes) you want.
If you are using another application server than Tomcat, please refer to the server's documentation to learn how to change the session timeout.
-
I've got a "Hey where is the licence file" message in the console of Jahia. What does that mean ?
A jahia.licence file should normally be located in the following directory:
jahiaedition3/tomcat/webapps/jahia/WEB-INF/etc/config/
This file locks (or unlocks) the number of users, site, pages and templates that can be created in Jahia. If Jahia does not find this file at startup time, the loading will failed and the mentionned message will be displayed.
The probable cause of this is if you change the jahia home disk path during installation. Jahia failed to find some directories and as a consequence displays this error message. Other causes of this problem could be:
- missing disk space during installation of Jahia, the extraction of all the files wasn't completed.
- modifications to the jahiaedition3/tomcat/webapps/jahia/WEB-INF/web.xml have been done.
- some obscur Tomcat bug might be present on some platform and doesn't give the right location of ressource files.
-
What is the jahia.properties file ?
The jahia.properties file is, as its name indicate, the property file for Jahia. It stores all configuration parameters used in Jahia. Database connection settings, disk paths as well as default site can be found in this file.
You can also set a few parameters which can not be changed through the graphical interface. Namely:
- outputCacheActivated : for testing or debugging purpose, you can desactivate permanently the HTMLCache of Jahia. Set this parameter to false to descativate it. By default, the HTMLCache is enabled (set to true).
- SiteIDinURL : Under normal cirumstances, Jahia will either use the fully qualified name (i.e. www.mywebsite.com) to access a specific virtual site if it has been specified in the site server name when setting up a new virtual site, or the "site key" (http://localhost/jahia/Jahia/site/my_web-site) if no valid site server name has been set up. However, you can force Jahia to always use the sitekey in the URL by setting this parameter to true.
- webapps.dispatcher.debug : When developping a new webapps, it can be useful to have as much log as possible available in the console. By default webapps produce no or minimal logs. Setting this option to true will enable log output for web applications. As this option produce a fairly large amount of log, keep it to false under normal circumstances.
-
Why do I have a message "Out of environment space" when running Jahia under Windows 95/98/Me ?
The "Out of environment space" problem is a common issue on Windows 98 platform, due to the size of the environment space that, by default, isn't really big.
One solution is to edit the CONFIG.SYS file and add this line:
SHELL=C:\COMMAND.COM C:\ /E:8192 /P
It may be possible that you already have a similar line, in that case you can increase the value after the '/E:' option, that is the size of the environment space. Remember to reboot. If you still have the same error, increase the number.
-
I'm using JDK 1.4.x and Jahia produce errors when running. Why is that so ?
JDK 1.4 has changed places for XML parsers. As a result, Jahia can not run with JDK 1.4
Version 1.3 should be used for Jahia < 3.1.3 ( http://java.sun.com/j2se/1.3/ ).
-
I've switched to the last version of Tomcat and now Jahia produce errors. Why ?
Currently Tomcat 4.0.2 or later is not supported with Jahia because of a bug in Tomcat's class loaders. You can check http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6374 for more details. You can also find there a workaround for Tomcat 4.0.3 that might work with Jahia. Basically it involves moving all the XML classes in tomcat/common/lib .
The bugfix should be included in Tomcat 4.0.4 but we're waiting on a final release before doing recommendations.
-
I've got an "JAVA_HOME variable is not set" message when trying to launch the Jahia install. Why ?
As Jahia is a Java application, it needs to know where is installed you version of JDK (or JRE). This is done through the use of the JAVA_HOME variable. Please refer to the section 1.x of this guide to see how to set up this variable.
-
I want to run Jahia under another application server. What servers are supported ?
Check the Jahia Application Server Compatibility Guide on the Jahia.org website for details of how to run Jahia on various application servers (http://www.jahia.org/jahia/Jahia/pid/132).
Please note that depending on the application server used, some functionalities of Jahia might not work.
-
I've tried several things but it is impossible to run Jahia. What can I do ?
First, make sure your configuration is supported by Jahia. Check section 1.1 of the Administration Guide or http://www.jahia.org/jahia/Jahia/pid/132 to verify that you are using supported versions of required softwares.
Try also to restart Jahia and/or to reboot your system, especially after the Jahia Configuration Wizard step.
If you still encounter problems, you can consult the Jahia Install mailing list at the following address: http://list.jahia.org/install_list/.
If you post a question regarding a problem you may have with Jahia and in order for us to better help you solving the issue, please provide us with the following information:
- Operating System and Database used
- Tomcat (or other application server) version and Jahia release.
- Java Virtual Machine used
- A copy of the error message if there is one
- Very important: steps followed until the problem is encountered so that we can better try to reproduce and hopefully fix the problem.
