| By Seema Alevoor, March 30, 2006 |
Before you begin, be sure your system hosts
With the preceding in place, establish Roller on your system as follows:
1. Download the Roller 2.0 application and unpack the ZIP or TAR file into a temporary directory.
%
cp roller-2.0-incubating.tar.gz
roller_temp_dir
%
cd
roller_temp_dir
%
tar xzvf roller-2.0-incubating.tar.gz
|
where roller_temp_dir could be /tmp
Use winzip to extract roller-2.0-incubating.zip into roller_temp_dir
where roller_temp_dir could be C:\tmp
This article assumes /tmp for UNIX and C:\tmp for Windows as the roller_temp_dir .
2. Follow the steps in Roller's Install Guide to create Roller tables in your database.
Now it's time for Web Server and Roller to meet.
This section describes six tasks:
.jar file..jar file.login.conf.For these tasks we use the terminology from the Roller installation example: user Scott with password tiger ; database, roller ; and so forth.
Copy the JDBC driver.jar file, for example, mysql-connector-java-3.0.17-ga-bin.jar), of MySQL Connector/J to webserver_install_path/bin/https/jar .
Here's how you add the .jar file to Web Server's class path.
1. Log in to the Administration GUI and select a server instance.
2. Click the Java tab.
A pane like that shown in Figure 1 is displayed.
![]() |
Figure 1: Adding a .jar File to Web Server's Classpath |
.jar path in the Classpath Suffix text field.1. Log in to the Administration GUI and select a server instance.
2. Click the Java tab.
A pane like that shown in Figure 2 is displayed.
![]() |
Figure 2: Adding a JDBC Connection Pool |
Text Fields, Properties, and Example Values |
Pool Name | mysql40 |
DataSource Classname | com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource |
Properties | |
serverName | localhost |
portNumber | 3306 |
User | scott |
Password | tiger |
databaseName | roller |
Note: The Pool Settings in Figure 2 are the defaults.
3. Click OK, and click Apply to save the settings.
1. Log in to the Administration GUI and select a server instance.
2. Click the Java tab.
A pane like that shown in Figure 3 is displayed.
![]() |
Figure 3: Adding a JDBC Resource |
Required Information and Example Values |
JNDI Name | jdbc/rollerdb | |||
Pool Name | mysql40 | |||
Data Resource Enabled | on | |||
3. Click OK, and click Apply to save the settings.
Copy the JAR file for JDBC Security Realm modified for Roller to web_server_install_path/bin/https/jar .
1. Log in to the Administration GUI to add the JAR file to the Web Server's class path, and select a server instance.
2. Click the Java tab.
A pane like that shown in Figure 4 is displayed.
![]() |
Figure 4: Customizing a JDBC Security Realm JAR File |
jdbcrealm.jar) path in the Classpath Suffix text field. jdbcrealm.jar for Web Server 6.1 SP5.1. Log in to the Administration GUI and select a server instance.
2. Click the Java tab.
A pane like that shown in Figure 5 is displayed.
![]() |
Figure 5: Adding a JDBC Realm |
Text Fields, Properties, and Example Values |
Realm Name | jdbc |
Classname | samples.security.jdbcrealm.JDBCRealm |
Properties | |
dbusername | scott |
dbpasswd | tiger |
dbdrivername | com.mysql.jdbc.Driver |
dburl | jdbc:mysql://localhost:3306/roller?autoReconnect=true |
usertable | rolleruser |
roletable | userrole |
usernamecol | username |
userpasswdcol | passphrase |
usergroupcol | rolename |
jaas-context | jdbcRealm |
This realm can either be configured as the default realm in server.xml or be specified in web.xml (see Appendix B) of the Roller application.
To add this realm as the default realm:
1. Log in to the Administration GUI and select a server instance.
2. Click the Java tab.
A pane like that shown in Figure 6 is displayed.
![]() |
Figure 6: Setting the Realm as the Default |
login.conf Add the following lines to the login.conf file in the webserver_instance_root/config directory.
jdbcRealm {
samples.security.jdbcrealm.JDBCLoginModule required debug=false;
};
|
Before deploying Roller to Web Server 6.1 SP5, do three things:
web.xml.sun-web.xml.For web.xml editing, refer to Appendix B.
Here is the code you use to create the sun-web.xml file in the /tmp/roller/WEB-INF directory.
sun-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Web Server 6.1 Servlet 2.3//EN'
'http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-1.dtd'>
<sun-web-app>
<security-role-mapping>
<role-name>editor</role-name>
<principal-name>roller</principal-name>
<group-name>editor</group-name>
</security-role-mapping>
<resource-ref>
<res-ref-name>jdbc/rollerdb</res-ref-name>
<jndi-name>jdbc/rollerdb</jndi-name>
</resource-ref>
</sun-web-app>
|
Create the WAR file as follows:
%
cd /tmp/roller
%
jar cvf .../roller.war *
|
Now deploy temp_dir/roller.war to Web Server 6.1 SP5!
A pane like that shown in Figure 7 is displayed.
![]() |
Figure 7: Deploying Roller to Web Server 6.1 SP5 |
/roller for the Application URI.Restart Web Server 6.1 SP5 and verify that the application is working by accessing http://localhost: WebServer-port/roller .
The configuration changes are the same as those for Roller 2.0 on Web Server 6.1 SP5 with these exceptions:
roller-2.1.1-incubating.tar.gz. Download it and unpack the ZIP or TAR file into a temporary directory, as described in " Setting Up." login.conf file.Roller 2.1.1 requires JDK 1.5.X, but Web Server 6.1 SP5 by default points to JDK 1.4.X within Web Server's install directory. Web Server picks up the JDK path information from two places: from server.xml file within webserver_instance_dir/config directory or from wsenv in webserver_install_dir/bin/https/bin directory. To use JDK 1.5.X, change the files as follows.
Existing | Modified |
|---|---|
server.xml: (all on one line) <JAVA *javahome=" webserver_install_dir/bin/https/jdk"*> serverclasspath="..."... > | server.xml: (all on one line) <JAVA *javahome=" JDK1.5.X_path" *serverclasspath="..."... > |
wsenv: (all on one line) WS_JAVA=* webserver_install_dir/bin/https/jdk*; export WS_JAVA | wsenv: (all on one line) WS_JAVA = JDK1.5X path; export WS_JAVA |
web.xml changes described in Appendix B, add the following lines in web.xml to register the ContextLoaderListener listener.<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> |
The JDBC realm program for Roller can be made from the sample program in Web Server 6.1. Download the sample (in HTML) used for modification. The code lines you must change appear in blue-bold in the code file; these changes are required for the Roller application.
After modifying the code of JDBCLoginModule.java, follow the sample's tutorial steps (in web_server_install_path/plugins/java/samples/webapps/security/jdbcrealm ) to build the JDBC Realm JAR file ( jdbcrealm.jar).
web.xml Changes for Web Server 6.1 SP5 web.xml of the Roller application requires the following changes on Web Server 6.1 SP5.
Note: If you are running Roller 2.1.1, don't forget to register the ContextLoaderListener listener .
Note: "dispatcher" elements should be commented out for Servlet API 2.3 containers like Web Server 6.1.
