Get Rolling with the latest Roller Application on Sun Java System Web Server 7.0

Roller23-WS7 I had earlier posted a write up on configuring Roller 2.0 and Roller 2.1 on Sun Java System Web Server 6.1 SP5.  Now, I thought of trying out the latest version of Roller on our latest Sun Java System Web Server 7.0. It is so simple ! Give it a try....

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.
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.

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.







Comments:

Post a Comment:
Comments are closed for this entry.
About

seemaa

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today