Chapter 3. Customizing your installation

Thomas Heute

This section is intended to describe some customization features available in JBoss Portal.

3.1. Changing the port

It is common to have a server running on the port 80 instead of the default port 8080.

To change it, you need to edit the file $JBOSS_HOME/server/default/deploy/jbossweb-tomcat50.sar/server.xml and change the port value of the HTTP Connector. You can also change the value of the SSL port, by default it is set to 8443. Remember to uncomment the following when you have configured it:

      <!-- SSL/TLS Connector configuration using the admin devl guide keystore
      <Connector port="8443" address="${jboss.bind.address}"
           maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
           scheme="https" secure="true" clientAuth="false"
           keystorePass="rmi+ssl" sslProtocol = "TLS" />

Now you can restart JBoss and use the new port that you defined. On systems like Linux, you need privileges to be able to run a server on a port lower than 1000, starting JBoss on the port 80 as a regular user will not work, for testing you can log as root but is not recommended if the server is public as it could be a security breach in your system.

3.2. Changing the context path

By default, the "main" page of JBoss portal will be accessible at http://localhost:8080/portal/index.html . You may want to change that either to a different name or to http://localhost:8080/index.html .


To do so, edit the file $PORTAL_HOME/build/ and change portal.context-root to anything you want.

Now you can rebuild JBoss portal and redeploy it for the context path changes to take effect.

3.3. Forcing the DB dialect

If you encounter that the Hibernate dialect is not working properly and would like to override the default behaviour, follow the instructions contained in this section:


Under most common circumstances, the auto-detect feature should work fine.

3.3.1. DB Dialect settings for the portal core

Modify jboss-portal.sar/conf/hibernate/[module]/hibernate.cfg.xml. A list of supported dialects for Hibernate3, can be found here .

               <?xml version='1.0' encoding='utf-8'?>
               <!DOCTYPE hibernate-configuration PUBLIC
               "-//Hibernate/Hibernate Configuration DTD//EN"
               <property name="connection.datasource">java:PortalDS</property>
               <property name="show_sql">false</property>
               <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
               <property name="cache.use_query_cache">true</property>
               <!-- Force the dialect instead of using autodetection -->
               <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
               <!-- Mapping files -->
               <mapping resource="conf/hibernate/user/domain.hbm.xml"/>

3.3.2. DB Dialect settings for the CMS component

Modify jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml. A list of supported dialects for Hibernate3, can be found here .

You will be searching this file for the commented "org.hibernate.dialect." blocks. Once found, replace with whichever dialect you are trying to force from the Hibernate list. There are 5 such commented blocks in this file. Make sure you uncomment them all!

3.4. Configuring the Content Store Location

By default, the JBoss Portal CMS stores all node properties, references, and binary content in the database, using the portal datasource. The location of some of these items is configurable.

3.4.1. Configuring a FileSystem Store

You will note that the jackrabbit configuration file is set to use the HibernateStore and HibernatePersistenceManager classes, by default. To have the CMS use 100% file system storage, simply comment these blocks. Then, you should uncomment to use the LocalFileSystem and XMLPersistenceManager classes. The repository configuration file is located under: jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml. Remember to perform this switch for the Repository, Workspace, and Versioning attributes.

3.4.2. Configuring External Blobs with a DB Store

Some enterprise deployments that serve large multimedia content prefer to not have the large files stored in the DB, along with all the property and node information. When using the HibernateStore and HibernatePersistenceManager, you can elect to have binary content stored on the local filesystem. Under the WorkSpace and Versioning nodes, set externalBlobs to true to achieve this.