One of the biggest problems I have in writing this column (if you can call it a problem) is selecting a topic for the month. There are just so many from which to choose! Occasionally, the stars align properly, and I get an email or phone call just at the time I'm narrowing my focus. Such is this case with this month's subject.
I'd Like a Web Site, Please...
I recently received a phone call from a long-time client who publishes a high school football newspaper and a high school wrestling newspaper. He and his partner wanted to create a subscription Web site and eventually move their publications to the Web, in a manner similar to MCPressOnline.com. Both of these gentlemen know the basics of HTML and maintain some popular sports Web sites. But the means they use to do it, static HTML via Microsoft FrontPage, is not conducive to a high-traffic Web site with frequent content change. What is required in a situation such as this is a Web site that is database-driven--a member of the genre of software known as "content management systems (CMS)." His phone call was to enlist my assistance with engineering such a site.
The Components
The basic components of any content management system are straightforward. You need a Web server, a database management system, and a Web scripting or CGI language. For an iSeries shop, that equates to the original HTTP server (or the Powered by Apache Web server), DB2 for iSeries, and one or more of the languages available on the iSeries, such as Java or RPG IV. In the open-source world, this combination of server, database, and scripting language is commonly referred to as LAMP, an acronym for Linux, Apache, MySQL, and one of the "P" languages in the list: Perl, Python, or PHP (Hypertext Preprocessor).
Getting back to my clients for a moment, let's review some of their requirements. First, their desired site needs to support a public area as well as a "premium" service, which is accessible only to members who have paid a subscription fee. Payment for the premium service needs to be supported via PayPal. Next, the site must support a forum so that the sports junkies who frequent it can hold life-affirming discussions. A further requirement is to support an image gallery where photos of various events can be posted for the denizens of the site. Finally, all of this has to be done on a relatively small budget.
I don't imagine that many of your companies would have a use for a sports Web site (overtly, anyway), but I'm sure that many of them could make use of a site like this for an intranet. And with today's IT budgets, the last requirement in the aforementioned list (small budget) is probably at the top of your company's list. What to do?
Choose Your Weapon
Obviously, the budgetary requirements of this project preclude any major customized development. So a site built from the ground up is not only out of the question, it's totally unnecessary. A little Google searching in both Web sites and newsgroups pointed me to a wonderful open-source CMS known as PostNuke. PostNuke is built around the Web scripting language PHP (itself an open-source project), which is the open-source equivalent of Microsoft's Active Server Pages (ASP).
Of the LAMP requirements for PostNuke, only MySQL is not normally loaded when installing Red Hat Linux (the distribution I use and the one I'll be discussing in this article). Red Hat favors PostgreSQL (another open-source database management system) and will load it if "database server" is checked during the install process. Not to worry, though; the Red Hat Package Managers (RPMs) for MySQL are provided on the installation CD. Just install the following three packages: mysql-server, mysql, and php-mysql (see last month's article on RPM for instructions). The first two packages provide the database server and client functionality. The third package provides the connectivity between the database server and PHP (think ODBC or JDBC driver, and you'll be in the ballpark).
Spinning Up the Nukes
Once you have the the basics up and running (don't forget to issue the command service mysqld start once you've installed MySQL), you need to acquire the PostNuke software. Point your browser to the PostNuke Web site and download the latest release. The release mentioned on the main site is .726RC3 (as in .726 Release Candidate 3). It seems to work well for me, but if you're squeamish about betas (no matter how solid they appear to be), you can download the latest production release (.723).
While you're in the mood for downloads, I highly recommend Drew Vogel's Official PostNuke Installation & Getting Started Guide which is available in a number of formats. I prefer PDF so that I may view it offline. I'm going to review the steps you'll need for the installation of PostNuke only briefly, since Drew's document provides detailed instructions.
In a nutshell, here are the steps for installing PostNuke:
Create a directory in your Web server's root directory to contain your PostNuke site. For a default Red Hat installation, that would be var/www/html. Whatever you name your site will become part of the URL to access it; thus, I created the directory /var/www/html/postnuke so that my URL would be http://localhost/postnuke.
- Extract the PostNuke files in a temporary directory and copy them to the directory you created in step 1.
- Change the ownership of the directory and files you created in step 1 to that of the user under which your Web server runs. For Red Hat Linux, that user is Apache. Issue the command chown -R apache.apache /var/www/html/postnuke and that step is completed.
- Create the database and database user for your site (see Appendix A of Drew's docs).
- Point your browser at the install script and complete the forms provided. To continue our example, the URL is http://localhost/postnuke/install.php.
- Customize your site to your preferences.
- Once you are satisfied that everything is working properly, delete the install.php file and install/ directory from your Web site. This ensures that it's not rerun by someone else.
Total time to install should be less than one hour if you've never installed the software before. Once you've done it, the process will take less than 15 minutes!
Getting More Bang for Your Buck
After you have experimented with your new site, you may notice that three of the requirements I mentioned earlier (image gallery, PayPal, and forum) are missing. That's because they don't come with PostNuke. Fortunately, PostNuke is meant to be fully extensible--the APIs are easily obtained from the project Web site. The result is that there is a huge volume of add-on modules available. To fulfill the image gallery requirement, I used a module called the Magnish Image Gallery. The PayPal functionality comes from www.postnukemodules.com. For the forum function, the de facto standard is PNphpBB2.
Installation of additional modules is simplicity itself. Just change to the "modules" directory under the PostNuke Web site's root directory and then extract the downloaded files using tar or unzip. Next, log on to your site as the administrator you created during setup, choose the modules link from the Administration link, and then choose Modules from the Administration page. Click on Regenerate, and your modules will appear in the available list. Initialize and activate them (using the provided links), and they will meld right into your nuked site.
Open Source Explodes onto the Web
Even though I have spent many years working with open-source software, I'm continually amazed by the quality that much of the software has achieved. PostNuke (and php-nuke, the project from which the PostNuke code was forked) provides a very easy way to get a professional-looking Web site with outstanding functionality.
As a Web scripting language, PHP is certainly as good as any of the others that are available. I still think that server-side Java has the upper hand in terms of scalability because JSPs are compiled into servlets, not interpreted with every page request. All things being equal, I would expect that, with a Java-based site, performance will remain more consistent as site usage increases. And, of course, if you really want PostNuke but are hard-core Java, you can get Java PostNuke. This link will take you to an article on the PostNuke site that will give you the details.
So how did my clients like their new site? They were delighted. The minor customizations that they wanted were simple for me to implement, since PHP is a simple language to learn. Judge the results and decide for yourself. Once you learn to recognize a nuked site, you'll be surprised by how many popular Web sites are "Powered by PostNuke."
Barry L. Kline is a consultant and has been developing software on various DEC and IBM midrange platforms for over 20 years. Barry discovered Linux back in the days when it was necessary to download diskette images and source code from the Internet. Since then, he has installed Linux on hundreds of machines, where it functions as servers and workstations in iSeries and Windows networks. He recently co-authored the book Understanding Linux Web Hosting with Don Denoncourt. Barry can be reached at
LATEST COMMENTS
MC Press Online