Roller 2.1 on GlassFish
http-equiv="content-type">
Deploying
href="http://rollerweblogger.org/">Roller 2.1 on
href="https://glassfish.dev.java.net">GlassFish.
The Roller 2.1 switched its security system to the Acegi security
framework and moved away from container managed authentication.
This allows deploying the Roller on GlassFish without having to add a custom JDBC Realm.
Please refer to
href="http://rollerweblogger.org/wiki/Wiki.jsp?page=InstallationGuide_2.x">The
Roller InstallationGuide for complete installation and
configuration steps for the Roller Weblogger Project.
STEP 1: Prerequisites
STEP 2: Download\Install GlassFish
1. href="https://glassfish.dev.java.net/public/downloadsindex.html">Download
GlassFish
(
style="font-style: italic;">b38 or later for
style="font-style: italic;"href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=221">ClassCastException:
net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken issue style="font-family: monospace; font-style: italic;"> fix)
2. Run:style="font-family: monospace;">java -Xmx256m -jar filename.jar3. cd glassfish
4. Run:
ant -f setup.xml
See the href="http://glassfish.dev.java.net/downloads/quickstart/index.html">GlassFish
Quick Start Guide for basic steps to start the server and deploy an
application.
STEP 3: Download\Install Roller
Step 3.1 : Download Roller
Download Roller 2.1.
(The official Roller 2.1 release should be out style="font-weight: bold;">very soon. For now, you'll have to get it from its subversion repository and build it yourself).
Unpack the downloaded TAR file.
% cp roller.tgz
<temp_dir>/roller% cd <temp_dir>/roller% tar xzvf roller.tgzOn Windows: Use winzip
to extract roller.zip into
Step 3.2 : Minor changes to Roller
since it has a 2.3 DTD, yet it still contains 2.4 elements. ( style="font-style: italic;">Discussion is happening on the roller list
about this so I think the changes should be in soon)
Also, I had to make some changes to jsp files (mainly in
login-redirect.jsp and taglibs.jsp) for jstl 1.1 taglib uri upgrade.You can download working version of roller.war here.
STEP 4: Create Roller tables in
your database
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.
- WEB-INF/dbscripts/mysql/creatdb.sql - creates tables for MySQL
- WEB-INF/dbscripts/derby/createdb.sql - creates tables for Derby
- WEB-INF/dbscripts/postgresql/creatdb.sql - creates tables for
PostgreSQL
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
class="wikipage"
href="http://www.mysql.com/http://rollerweblogger.org/wiki/Wiki.jsp?page=MySQL">MySQL
(see page
href="http://rollerweblogger.org/wiki/Wiki.jsp?page=SettingUpUTF8OnMySQL">Setting
Up UTF8 on MySQL for details).
UNIX example
% cd <temp_dir>/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 <temp_dir>\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
href="http://rollerweblogger.org/wiki/Wiki.jsp?page=MySQL">MySQL
installation hasn't set the
href="http://rollerweblogger.org/wiki/Wiki.jsp?page=DebianMySQL">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
STEP 5: JDBC connection
Step 5.1 : JDBC driver jar
Connector/J and copy the jar into glassfish_install_dir/lib
(ex. glassfish_install_dir/glassfish/lib/mysql-connector-java-3.1.12-bin.jar).
You can also add the jar to the classpath via Admin GUI
(Admin GUI -> Application Server -> JVM settings -> Path Settings
-> Classpath Suffix) or domain.xml edit (
)
Step 5.2 : JDBC Connection Pool Setting
-> Application Server
-> Resources -> JDBC -> Connection Pools)
<jdbc-connection-pool allow-non-component-callers="false"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<property name="user" value="scott"/>
<property name="port" value="3306"/>
<property name="password" value="tiger"/>
<property name="databaseName" value="roller"/>
<property name="serverName" value="localhost"/>
</jdbc-connection-pool>
Step 5.3 : JDBC Resource Setting
Resources -> JDBC -> JDBC Resources)
<jdbc-resource enabled="true"
jndi-name="jdbc/rollerdb" object-type="user" pool-name="MySQL"/>
STEP 6: Deploy Roller to GlassFish
Step 6.1: sun-web.xml
sun-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" class="moz-txt-link-rfc2396E"
href="http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">"http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app>
<session-config>
<session-manager>
</session-manager>
</session-config>
<resource-ref>
<res-ref-name>jdbc/rollerdb</res-ref-name>
<jndi-name>jdbc/rollerdb</jndi-name>
</resource-ref>
<class-loader delegate="false"/>
</sun-web-app>
ClassNotFoundException: org.hibernate.hql.ast.HqlToken" href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=188">reported style="color: rgb(0, 0, 0);">. See Jan's href="http://blogs.sun.com/roller/page/jluehe">blog for more<class-loader delegate="false"/> is to address
"
details.
Step 6.2: Create war file
% cd <temp_dir>/roller% jar
cvf ../roller.war *Step 6.3: Deploy roller.war to GlassFish
(Admin GUI ->
Application Server -> Applications -> Web Applications ->
Deploy)
Step 6.4: Security
permission
glassfish_install_dir\glassfish\domains\domain1\server1\config\server.policy.
// permission for Roller: file upload, log setting, etc :
grant codeBase "file:${com.sun.aas.installRoot}/domains/domain1/applications/j2ee-modules/roller/-" {
permission java.security.AllPermission;
};
grant codeBase "file:${com.sun.aas.installRoot}/domains/domain1/generated/jsp/j2ee-modules/roller/-" {
permission java.security.AllPermission;
};
Although the above security permission works, more specific and
restrictive settings might be appropriate.
Now you should be able to check out your Roller app by accessing
http://localhost:8080/roller and register your first admin user.
Check out the Roller
href="http://rollerweblogger.org/wiki/Wiki.jsp?page=UserGuide">UserGuide
for more info.
href="http://blogs.sun.com/roller/resources/akihito/roller_on_sun_java_system_application_server_7.html">
Thanks to Allen Gilliland from the Roller team for helping me with Roller questions.
References:
href="http://rollerweblogger.org/wiki/Wiki.jsp?page=InstallationGuide_2.x">Roller
Installation Guide and
href="http://blogs.sun.com/roller/resources/akihito/roller_on_sun_java_system_application_server_7.html">Roller
Installation Guide on SJSAS7SE
- Login or register to post comments
- Printer-friendly version
- amyroh's blog
- 3624 reads





