Looking for Roller? The Official Roller Wiki is now hosted by the Apache Software Foundation.
How to install Roller. Last updated for Roller 2.1
See also:
Describes how to install Roller in the following environment:
What about other servlet containers? These instructions favor Tomcat, but with some expertise you should be able to make Roller work on any Servlet API 2.3 compatible Servlet Container (e.g. Weblogic, JBoss, WebSphere, Jetty, Resin, OrionServer, ...); Servlet API 2.4 support is recommended for sites requiring internationalization features. If you deploy Roller to a non-Tomcat server, please constribute your install notes to help others who might want to do the same.
What about other databases? These instructions favor MySQL, but Roller also includes database setup scripts for PostgreSQL and HSQL-DB. With some expertise you should be able to make Roller work on any JDBC accessible database (e.g. Oracle, Informix, Sybase, MS SQL Server, ...).
What platform combinations are known to work? For information on which platforms we can vouch for, see the Platforms page.
Before you install the Roller software you need to make sure you have installed your Java SDK, your Tomcat Servlet Engine, and your ~MySQL database installed and configured on your system.
As part of the Tomcat install, you should have set an environment variable called CATALINA_HOME as show in the example below. I'm telling you this now because later, in other examples in this guide we will refer to the CATALINA_HOME variable.
UNIX (csh) example
% setenv CATALINA_HOME /opt/jakarta-tomcat-5.0.29
Windows example, from an MS-DOS or Command Prompt window:
C> set CATALINA_HOME d:\jakarta-tomcat-5.0.29
Notes
In this step, you unpack the ZIP or TAR file that downloaded into your Servlet Container's web application deployment directory. Tomcat's deployment directory is located in the webapps directory of the Tomcat install directory.
UNIX example
% cp roller-2.0-incubating.tgz $CATALINA_HOME/webapps
% cd $CATALINA_HOME/webapps
% tar xzvf roller-2.0-incubating.tgz
On Windows: Use WinZIP to extract roller.zip into %CATALINA_HOME%\webapps
Now you need to create a new database, create a user with appropriate privileges, and use an SQL script to create the database tables required to run Roller. To do this, login to your database and run one of the Roller database creation scripts located in Roller's WEB-INF/dbscripts directory.
The examples below show you how you might do this using ~MySQL, assuming your Roller user will have username scott and password tiger. For more information on ~MySQL, refer to the ~MySQL Reference Manual.
Make sure you enable UTF-8 support in MySQL (see page Setting Up UTF8 on MySQL for details).
UNIX example
% cd $CATALINA_HOME/webapps/roller/WEB-INF/dbscripts/mysql
% mysql -u root -p
password: *****
mysql> create database roller;
mysql> grant all on roller.* to scott@'%' identified by 'tiger';
mysql> grant all on roller.* to scott@localhost identified by 'tiger';
mysql> use roller;
mysql> source createdb.sql
mysql> quit
Windows example, from an MS-DOS or Command Prompt window:
C> cd %CATALINA_HOME%\webapps\roller\WEB-INF\dbscripts\mysql
C> mysql -u root -p
password: *****
mysql> create database roller;
mysql> grant all on roller.* to scott@'%' identified by 'tiger';
mysql> grant all on roller.* to scott@'localhost' identified by 'tiger';
mysql> use roller;
mysql> source createdb.sql
mysql> quit
Notes:
~MySQL users, don't forget to call "flush privileges" and make sure that your MySQL installation hasn't set the skip-networking option. Connector/J can only access ~MySQL via TCP/IP. The ~MySQL command line tool however doesn't use TCP/IP sockets by default. To check whether your connect works, use anything other than "localhost" as host, for example:
mysql roller -h 127.0.0.1 -u scott -ptiger
You will need to download and "install" a couple of requred jars: JDBC driver jar(s) and the ~JavaMail jars.
Roller uses the database connection pool provided by your application server, which you will configure in the next step. If your application server is to create database connections to your database, your application server will need the JDBC driver jar for that database.
For Tomcat, place your JDBC driver jar(s) in Tomcat's common/lib directory.
UNIX example: unzip and untar the MySQL Connector/J download into a directory, cd to that directory and then copy to Tomcat common/lib
% cp mysql-connector.jar $CATALINA_HOME/common/lib
Windows example, from an MS-DOS or Command Prompt window: unzip the MySQL Connector/J download into a directory, cd to that directory and then copy to Tomcat common/lib
C> copy mysql-connector.jar %CATALINA_HOME%\common\lib
Notes
.
Roller can be configured to send email notifications of comments. If this is to work, Roller needs ~JavaMail and Activation jars. Roller now includes these in the distribution. For Tomcat, you need to move (not copy) the files mail.jar and activation.jar from Roller's WEB-INF/lib directory to your CATALINA_HOME/common/lib,
(removing them from the web app). Note that if you enable the mail functionality, these jars must be in the Tomcat common/lib directory and should be removed from the distribution WEB-INF/lib directory.
In order to enable the mail functionality, you will also need to include the section on the mail session resource in your context descriptor file, as described in the following sections, and in the Admin | Configuration page, you will need to enable the functionality for e-mailing comments.
Deploy Roller to your J2EE application server. You have to do three things:
For Tomcat users, this means defining the Roller Servlet Context. This is where you configure the Servlet Authentication to use the Roller database tables and where you configure the Roller datasource.
You can do this in one of two places:
Example for Tomcat 5.0.X Users
If you are using Tomcat 5.0.X as a container use the example context definition from this section. If you are using Tomcat 5.5.X as a container, follow the example in the next section. There are some differences.
To avoid some browser-specific issues with displaying and cutting/and pasting this XML, we recommend that instead of cutting and pasting from this screen that you download the attached example context configuration for Tomcat 5.0 roller_tomcat_5_0.xml
and edit the contents as described in the comments within that downloaded file.
The examples assume you are using MySQL. If you use an alternate database, you need to change the two jdbc URLs as appropriate for your database.
If you use the example here, make sure you replace scott/tiger with your MySQL username and password. If you use the example file, make sure you replace the names as described within the comments at the top of that file.
<Context path="/roller" docBase="roller" debug="0">
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="com.mysql.jdbc.Driver"
connectionURL=
"jdbc:mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
connectionName="scott"
connectionPassword="tiger"
userTable="rolleruser"
userNameCol="username"
userCredCol="passphrase"
userRoleTable="userrole"
roleNameCol="rolename" debug="0" />
<Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource" />
<ResourceParams name="jdbc/rollerdb">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>
jdbc:mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8
</value>
</parameter>
<parameter><name>username</name><value>scott</value></parameter>
<parameter><name>password</name><value>tiger</value></parameter>
<parameter><name>maxActive</name><value>20</value></parameter>
<parameter><name>maxIdle</name><value>3</value></parameter>
<parameter><name>removeAbandoned</name><value>true</value></parameter>
<parameter><name>maxWait</name><value>3000</value></parameter>
</ResourceParams>
<!--
To enable email notification of comments: uncomment the resouce below,
set your mailhost, and make sure you have mail.jar and activation.jar
in <tomcat>/common/lib.
-->
<!--
<Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>mailhost.example.com</value>
</parameter>
</ResourceParams>
-->
</Context>
Example for Tomcat 5.5.X Users
In Tomcat 5.5.X, you still place the context definition in either the server.xml file or in the conf/Catalina/localhost directory. However, the manner in which you define resource parameters has changed. For Tomcat 5.5.X, resource parameters must be defined as attributes on the Resource element; the ~ResourceParams element is not supported. You can use the following example as a starting point for your configuration. This is for Tomcat 5.5.X only; for Tomcat 4.X and 5.0.X containers, use the form shown in the previous section.
To avoid some browser-specific issues with displaying and cutting/and pasting this XML, we recommend that you download the attached example context configuration for Tomcat 5.5 roller_tomcat_5_5.xml
.
If you use the example here, make sure you replace scott/tiger with your MySQL username and password. If you use the example file, make sure you replace the names as described within the comments at the top of that file.
<Context path="/roller" docBase="roller" debug="0">
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
connectionName="scott"
connectionPassword="tiger"
userTable="rolleruser"
userNameCol="username"
userCredCol="passphrase"
userRoleTable="userrole"
roleNameCol="rolename" debug="0" />
<Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
username="scott"
password="tiger"
maxActive="20"
maxIdle="3"
removeAbandoned="true"
maxWait="3000" />
<!--
To enable email notification of comments: uncomment the resouce below,
set your mailhost, and make sure you have mail.jar and activation.jar
in <tomcat>/common/lib.
-->
<!--
<Resource name="mail/Session" auth="Container" type="javax.mail.Session"
mail.smtp.host="mailhost.example.com" />
-->
</Context>
Context Configuration Notes
.
.
Roller's approach to internationalization (I18N) is to do everything in UTF-8. If you want I18N to work properly, you'll need to configure your application server and your web server to use UTF-8 encoding.
Web application server URI encoding
Make sure that your web application server uses UTF-8 to encode URI's. This allows you to use diacritical characters like 'รง' in your urls. This is important for Roller because Weblog Entry titles are used in URLs.
Example: In Tomcat, the URI Encoding is specified in the Connector of the server.xml file:
<Connector port="12345"
enableLookups="false"
URIEncoding="UTF-8"
redirectPort="8443"
debug="0"
protocol="AJP/1.3" />
Note: You need to do this for every connector through which you use Roller. For example, if you use the HTTP connector directly rather than AJP and Apache, you would need to add the URIEncoding="UTF-8" attribute to that Connector element as well, and similarly for the HTTPS connector if you use that.
Web server page encoding.
If you use a separate web server like Apache to render static content, make sure the page encoding of the web server is set to UTF-8.
Example: In case of Apache 2.x, use the ~AddDefaultCharset directive.
AddDefaultCharset utf-8
Roller needs to store search-index, cache and log files to disk. So before you run Roller you need to ensure that Roller's data directories are created and are writable by the Roller process. By default Roller uses the following directory structure:
By default, Roller saves uploaded files under the directory ${user.home}/roller_data/uploads . Here ${user.home} is the Java system property that normally evaluates to the home directory of the user identity executing the server's JVM process.
In most cases, this default will probably work fine for you. However, for security reasons, some Tomcat installations (and other containers as well) are set up to run as a server user identity whose home directory does not exist or is not writable by the server user itself. If this is the case for your site, override the property uploads.dir in roller.properties (see ConfigurationGuide for details).
By default, Roller creates and maintains its text search index data in files under the directory ${user.home}/roller_data/roller-index . Here ${user.home} is the Java system property that normally evaluates to the home directory of the user identity executing the server's JVM process.
You can specify a different directory by overriding the property search.index.dir in roller.properties (see ConfigurationGuide for details).
You only need to do this if you are planning on using Roller's integrated planet aggregator: create a directory for the planet cache (e.g. /var/roller/planet-cache).
The planet aggregator is off by default. To enable it, you'll have to override the planet.aggregator.enabled property (see the ConfigurationGuide). Once you've got Roller up and running, login (as an adminstrator), go to the Planet:Configuration page and set full-path to the directory you choose for the planet-cache.
Currently, you must specify the location of the planet-cache directory through the Roller web UI (but we planning to move it to roller.properties because it is really a startup property).
The roller.log file is written to the location ${catalina.base}/logs/roller.log". Make sure that that this directory exists. Tomcat 5.0.X users will normally have this directory by default. Tomcat 5.5.x users may need to create this subdirectory under their base directory.
You can configure much of Roller through the Roller web UI, but there are a set of configuration properties that must be defined at startup. Before you startup Roller for the first time, you should review these properties. You may be perfectly happy with the default configiuration, but if you're not then you can change it.
Please review the default startup configuration properties shown in the Configuration Guide and decide if you want to override any of them. Once you've done that you're ready to start Roller.
Start your Servlet Container, open your web browser, browse to the Roller start page and start using Roller.
If you are installing Roller on Tomcat then your Roller start page URL is probably http://localhost:8080/roller
.
UNIX example:
% cd $CATALINA_HOME/bin
% ./startup.sh
Windows example, from an MS-DOS or Command Prompt window:
C> cd %CATALINA_HOME%\bin
C> startup
You are done! Roller should be working perfectly now. If not, then please consult the InstallationFAQs and then check with the experts on the Roller mailing lists. Somebody has probably encountered the very same problems that you are encountering.
NOTE: the first user you create will have administrator privileges, so make sure you create the first user yourself. An admin user can grant and revoke admin rights from other users.
Now that have installed Roller and verified that it is working, there are some other steps you might wish to take.
For Roller versions 2.1 and higher, you should change the keys in the WEB-INF/security.xml to your own site-specific secrets before making your site public. These keys are used to compute hashed message authentication code values on cookies. Using the default values could expose your site to forged logins.