Back to Dot-Com Builder How-Tos Archive
Deploying Forums on Your Site Using Jive
by Eric Larson Discussion forums, also known as bulletin boards or community forums, are nothing new to the Internet. For more than 20 years, newsgroups have been available through Usenet (network news) -- users subscribe to post or read messages. Even though Usenet is still widely used, it has been augmented by centralized site-specific software: discussion forums on individual Web sites. Why Forums? Discussion forums can be a great addition to any site. Not only do they allow users to interact with each other, but they also provide a way for the site's creators to get and provide feedback. Rather than simply deliver content to your readers, why not allow your readers to post content as well? When archived and searchable, forums can become an indispensable information tool. Mailing lists and live chat also provide options for building your community, but discussion forums may give you the best of both. While chat rooms are in real time, they require that users interact online concurrently. Client software is often needed, and technical difficulties can make chat software harder to deploy than forums. Mailing lists can also build a community, but they are usually an all-or-nothing alternative: Users receive all messages to a mailing list (although "bulk" mailing can cut down the actual number of messages received). Again, forums provide another alternative by allowing users to read and respond to messages anytime without having to read all messages. Why Jive? When considering how to implement discussion forums on your site, you have a few options. You could write your own software from scratch using whichever server-side technology you like. You could install any number of third-party commercial or open-source forum software packages, or you could opt for an ASP-hosted forum solution. Sun's Developer Connection sites (including Dot-Com Builder) used forum software that was originally developed in-house. As the sites grew, the software became harder to maintain and scale, so a service provider was chosen to provide forums for the sites. However, this solution had a downside -- the developer sites would not have control of the source code. The latest software on the sites is an open-source forums package called Jive. Written in the Java programming language, Jive is one of the most robust, easy-to-use forum implementations available. Although it may not be the perfect solution for everyone, Jive is worth a look if you're considering adding forums to your site or replacing existing forums software. Jive has many strong points that make it a capable addition to even the largest sites, such as:
Server Environment If you want to deploy Jive, or at least give it a test drive, you need the following:
The Java 2 SDK can be download from Java.sun.com here. If you need a servlet engine, Tomcat is the official servlet and JSP reference implementation. Tomcat can be used as a servlet engine along with your existing Web server to provide support for servlets and JSP technology. For testing and development, or if you don't have any static content, Tomcat can be used without a Web server. Jive supports more than 10 popular databases, so getting it to work with yours should be simple. Even if your database isn't listed, you should be able to use any database that has a JDBC driver available. If you don't already have a database installed, MySQL is a complete open-source SQL RDBMS that runs very well on most platforms. Don't be too worried if you aren't a database guru. Setting up MySQL for general use isn't very complicated, and installed right out of the box (or off the Web), it should be adequate for using with Jive. Installing Jive Make sure your Web server and database environment are functioning properly. Ensure that servlets and JSP technology load correctly. If you haven't used the JDBC driver to access your database yet, you might consider running a simple Java test program to certify the driver can access the database without error. Your JDBC driver might have come with some samples; if not, the JDBC Guide: Getting Started has some good information. Download Jive from here. Unzipping the file will create a Jive directory with all of the application files and documentation. Installation instructions can be found in the documentation directory. Specific installation instructions are provided for several application servers and databases, but in general here is what you need to do:
Check the Jive documentation to see if specific instructions are included for your application server. If you are unsure how to set the classpath, check your application server documentation. Typically this just involves adding the full pathname to each jar file to a parameter in one of your application server's configuration files. To install the Jive database schema, you should first create a database user for accessing Jive. This is the username and password that Jive will use to access the database. For security reasons, don't use any of the default users or administration users. With some databases you will also need to create a tablespace or database for Jive. Once you've done this, you can run one of the included SQL scripts to create the Jive tables. The database schema can be viewed here. Once the database tables are created, you're ready to start the setup tool. The Jive Setup Tool The Jive setup tool is the last step in the installation process. Once you have the Jive classes (jar files) installed, and the JSP technology working, you should be able to access the setup tool by loading the setup.jsp in the admin/setup directory where you installed the skins. This will be a URL similar to the following: http://yourwebserver/jive/admin/setup.jsp If the setup page fails to load, there is probably a problem with the application server configurations. Double-check that all the required jar files are in the classpath. If the Jive classes are installed correctly, the setup tool will display the setup checklist, which highlights any other pieces that may not be configured properly. Once everything is working, you're ready to configure the database connection properties. You must specify the following properties on the database connection form:
Once Jive is able to connect to the database, you will be prompted to create an administrator account. This is the user who has complete control of forums, so choose a username and password carefully. You will also be prompted to supply a "Jive Home" directory, where Jive can write information to (mostly indexes for the search engine). Make sure your application server has permission to write to this directory. Forum and User Administration Once you've created an administrator account, you're ready to create your forums. The administration pages are located in the admin directory. Simply load the login.jsp page, and enter your administrator login and password. The Jive administration tool has two tabs: Global Settings and Forum Settings. To create a new forum, click on the "Forum Settings" and select "Create." Enter a forum name and description, and click "Create" to add a new forum. This should take you to the Forum Permissions page, which allows you to specify permissions for the forum you just created. A permissions summary is displayed, followed by forms to add user and group permissions. There are two default users: "Anonymous Users" and "All Registered Users." And there are three permissions: "read," "post thread," and "post messages." You need to decide if you want to allow anonymous posting. A typical forum might allow anyone to read messages, but only registered users can post (you must log in to post). In this case you would specify "I want anonymous users to be able to read contents of this forum" in the form, and add the user permission. If you don't specify this permission, no one will be able to read messages before creating an account and logging in to the site. In most cases you will want to allow registered users the ability to read, post threads (start new threads), and post messages (reply to existing threads). Typically, forum users will create their own accounts through the publicly available forum pages. But as a system administrator, you may also want to create accounts manually. This can be done through the administration tool as well as by assigning users to groups. Assigning users to groups allows you to easily restrict access to many users by specifying group permissions. You can also change permissions on a per-user basis. Under Global Settings are options for System Settings, Users, and Groups. Performance Once you deploy Jive on a busy site, you will certainly want to optimize Jive's performance as much as possible. Internally, the software does extensive caching. So, more RAM allocated for the virtual machine for the Java platform allows more caching for Jive. Tuning the database will certainly increase performance. Since most database contention will occur while reading from the database is done (more people read messages than post messages), the database should be tuned for reading if possible. If the database is shared by other applications, you should consider hosting the database on a dedicated server. Fast disks will speed database access as well, and plenty of RAM on the database and application servers will allow more connections to be pooled. Ideally, the database server should possess enough RAM to do in-memory sorts or the largest forum that your system will have. If the Web/application servers are having trouble keeping up with forum requests, the load can easily be split over multiple servers, or separate servers for reading and posting can be implemented. Front-end Customization The Jive distribution comes with two sample front-end implementations in the vodka and bay directories. Jive refers to these front ends as "skins." A skin is simply a JSP technology that defines the look and feel of the forums. JSPs can call Jive APIs through beans or stand-alone Java classes, and they can also make use of taglibs. Using the supplied examples, it is easy to customize Jive to look like a native piece of your site. The appearance of text in message bodies and subjects can also be filtered. The administration tool lets you define filters that can reformat message text. The default filters escape HTML tags and newlines so text displays properly in the browser. Other filters can be installed to filter content for profanity or to provide colored Java code syntax highlighting. Conclusion Jive's easy installation will get you up and running quickly, and its features and performance will satisfy you and your users. Jive has proven itself at Sun by supporting 94 forums with more than 358,000 messages, and about 2 million users. And the current infrastructure is not even close to capacity. As more developers try the software and contribute to the project, Jive's success will only continue. Try it out yourself, and post feedback here or at coolservlets.com. |
| ||||||||||||||||||||||||||