Prerequisites
Before you install the Roller software, please install Sun Java System Web Server 7.0 Technology Preview (it's FREE !!). And also have MySQL database installed and configured on your system.Building Roller Application
Checkout the latest version of Roller source (2.4 is the latest version which is under development and 2.3 is the stable version which is going to be out very soon. Check here) and build the Roller application. More information is available in the Roller's Developer Guide. After building, you can find the Roller web application in the build/roller subdirectory under <roller-checkout-dir>/trunk directory.Note: <roller-checkout-dir> is the directory under which you would have checked out the latest Roller source using the command
$ svn checkout https://svn.apache.org/repos/asf/incubator/roller <roller-checkout-dir>
I will refer <roller-checkout-dir>/trunk/build/roller directory as the roller-webapp-dir in the rest of this article.
Creating Roller tables in your database
Before creating roller tables, you need to create a new database, create a user with appropriate privileges. Then, use a SQL script to create the database tables required to run Roller. Database creation scripts for Roller are located in WEB-INF/dbscripts subdirectory of roller-webapp-dir.e.g, roller-webapp-dir/WEB-INF/dbscripts/mysql/createdb.sql - creates tables in MySQL database .
Roller's Install Guide has more details.
The example below shows how you can do the above, using MySQL.
For more information on MySQL, refer to MySQL Reference Manual.
On UNIX :
| $ cd
roller-webapp-dir/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 |
Configuring JDBC resource
- Download jdbc driver jar for your database.
e.g., You can
download the JDBC driver for MySQL database from here.
- Copy this jar to <webserver-instance-dir>/lib directory (create one if not already present). Web Server 7 will automatically load this jar during startup.
- Then configure JDBC resource on your Web Server, as follows using Web Server 7 Administration GUI :
a. Log on to the
Administration GUI.
b. Select a configuration. e.g., test
c. Click "Edit Java Settings" link under "Configuration Tasks" list
d. Then choose “Resources” tab under "Java".
e. Click on "JDBC Resources" link.
f. Click on "New" JDBC Resource button.
g. Choose your database vendor. e.g, for MySQL, select "MYSQL - MM Driver".
h. For MySQL, specify the following values . When ever required click on “Next” button to move to the next settings page.
b. Select a configuration. e.g., test
c. Click "Edit Java Settings" link under "Configuration Tasks" list
d. Then choose “Resources” tab under "Java".
e. Click on "JDBC Resources" link.
f. Click on "New" JDBC Resource button.
g. Choose your database vendor. e.g, for MySQL, select "MYSQL - MM Driver".
h. For MySQL, specify the following values . When ever required click on “Next” button to move to the next settings page.
-
JNDI Name jdbc/rollerdb DataSource Classname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource Properties serverName localhost portNumber 3306 User scott Password tiger databaseName roller
i. Click "Finish" and
"Close" buttons.
j. To apply changes to the instance, click on "Deployment Pending" warning link at the top right corner of the page.
j. To apply changes to the instance, click on "Deployment Pending" warning link at the top right corner of the page.
server.xml would have the
following entries after the above configuration:
|
<jdbc-resource> <jndi-name>jdbc/rollerdb</jndi-name> <datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</datasource-class> <property> <name>password</name> <value>tiger</value> </property> <property> <name>user</name> <value>scott</value> </property> <property> <name>databaseName</name> <value>roller</value> </property> <property> <name>serverName</name> <value>localhost</value> </property> <property> <name>port</name> <value>3306</value> </property> <description></description> </jdbc-resource> |
Creating Roller WAR file
Before creating the WAR file, some changes are required to Roller files in order to successfully run the application on Web Server 7.0 . Those changes are:- Replace "/j_security_check" URI within loginBody.jsp file under roller-webapp-dir and security.xml file under roller-webapp-dir/WEB-INF directory with some other value like "/j_roller_security_check" .
- Then create the WAR as follows:
$ cd roller-webapp-dir
$ jar cvf
./roller.war *
Deploying the Roller WAR file
Follow the below steps to deploy roller-webapp-dir/roller.war to Sun Java System Web Server 7.0 .- Log on to the Administration GUI.
- Select a configuration and virtual server
- Click on “Add Web Application” link under "Virtual Server Tasks" list.
- Specify the location of roller.war and "/roller" for "URI".
- Click OK.
- To apply changes to the instance, click
on "Deployment Pending" warning link at the top right corner
of the page.
Running Roller Application
Restart the Web Server and access :http://<We-Server-host>:<Web-Server-port>/roller
Congratulations ! You are now hosting the blogging site.