| By Seema Alevoor and Marina Sum, March 16, 2007 |
A March 2006 article, Running Roller Weblogger on Sun Java System Web Server 6.1 SP5 , shows you how to configure popular, open-source Roller Weblogger (henceforth, Roller) 2.0 or 2.1.1 on Sun Java System Web Server 6.1 SP5 with MySQL 4.x. Now that Sun Java System Web Server 7.0 (henceforth, Web Server 7.0) is available, this article updates the procedures involved to enable you to run Roller 3.0 on that latest Web Server release.
Note: Type all the commands on one line even though some of them wrap to the next line because of page width constraints.
ContentsFirst, download Web Server 7.0. Afterward, install and configure the MySQL database.
Second, follow these steps to set up Roller:
apache-roller-3.0-incubating.tar.gz. % cp roller-3.0-incubating.tar.gz Roller_temp_dir % cd Roller_temp_dir % tar xzvf roller-3.0-incubating.tar.gz /tmp. winzip to extract roller-3.0-incubating.zip into Roller_temp_dir. /apache-roller-3.0-incubating/webapp/roller directory as roller-webapp-dir. hibernate.tar.gz file in a directory, say, /tmp/hibernate. /WEB-INF/lib directory. hibernate3.jar, is in the /tmp/hibernate/hibernate-3.1 directory. The other seven files reside in the /tmp/hibernate/hibernate-3.1/lib directory: hibernate3.jar | dom4j.1.6.1.jar | |
asm-attrs.jar | ehcache-1.1.jar | |
asm.jar | jdbc2_0-stdext.jar | |
cglib-2.1.3.jar | jta.jar | |
Before creating Roller tables, first create a database and a user with the appropriate privileges. Afterward, run the SQL script to create the database tables required to run Roller. The scripts for creating databases for Roller are in the roller-webapp-dir /WEB-INF/dbscripts subdirectory.
The following command lines are an example of how to accomplish the above with MySQL on UNIX. For details on MySQL, see the MySQL Reference Manual .
% 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
|
Note: If you are upgrading the Roller database with the 240-to-300-migration.sql script, before running that script, edit it and change the pagemodels column size from 512 to 255, as follows:
-- add new column which holds the list of custom models in a weblog alter table website add column pagemodels varchar(255) default null; |
Otherwise, table updates in Roller will fail and cause runtime errors.
Roller stores uploaded files, search index files, cache files, and log files on disk. Verify that the directories that Roller expects exist and are writable by the Web Server process:
/roller_data/uploads directory, where user.home is the name of the Java system property that points to the user's home directory. /roller_data/search-index directory.To change the defaults referred to in the two preceding steps, see steps 7 and 8 of the Apache Roller Installation Guide (PDF) .
Now revise two Roller files and then create the Roller Web archive (WAR) file:
/j_security_check URI in the roller-webapp-dir /jsps/core/login.jsp file and the roller-webapp-dir /security.xml file with another value, for example, /j_roller_security_check. j_security_check performs container-managed authentication, which Roller does not use. Leaving j_security_check as the URI causes the Web Server container to authenticate and results in a failure. % cd roller-webapp-dir % jar cvf ./roller.war *Now configure the Java Database Connectivity (JDBC) resource:
/lib directory. test. Figure 1: Specifying the JNDI Name |
Figure 2: Specifying the Properties for the JDBC Resource |
com.mysql.jdbc.jdbc2.optional.MysqlDataSource. The server.xml file will then contain the following entries:
<jdbc-resource>
<jndi-name>jdbc/rollerdb</jndi-name>
<datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</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>
|
Finally, deploy the WAR file to Web Server 7.0:
roller.war file and type /roller for the URI. Click OK. Now run Roller: Restart Web Server 7.0 and go to http:// web-server-hostname : web-server-portnumber /roller.
The configuration procedure for hosting Roller on Web Server 7.0 is straightforward and intuitive. Given the many robust capabilities that accompany Web Server 7.0, it makes perfect sense to host Roller there.
