The question shouldn’t be whether you’ve heard of Slashdot, but how often you visit. When you come across a site that’s so loaded with great Open Source information and discussions, it’s difficult not to make visiting it a regular part of your work routine. In addition to regular visitations, did you know that you could also use the entire structure behind Slashdot to create your own discussion forum? No purchasing, no licensing, no first-born children are necessary. The Slashdot structure is an open source application that you can download, install, use, and even modify. Think of what such a useful information and discussion site could mean to your users, customers, and vendors.
In this Daily Drill Down, I will show you how to install and configure this powerful discussion forum software. The instructions that are bundled with Slash are far less than detailed, so I will fill in the blanks to make the process easier. Once you get your own Slash server up and running, you’ll wonder how you ever managed without it.
Preinstallation set up
To make the Slash installation easier, you need to create a group named slash for all users related to Slash and create a user named slash by typing the following commands at the system prompt:
/usr/sbin/useradd -g slash slash
Now, you are ready to move on to the Slash installation.
Slashcode requires that certain software be installed in order for it to function properly. You’ll need to have the following components up and running before installing and configuring Slashdot:
- · Perl 5.005_03 or above
- · MySQL 3.23 or above
- · Apache 1.3.6 or above
- · Mod_perl 1.21 or above
- · Sendmail or another mail transport daemon
To show you how to set up each component for a Slashcode installation, I will walk through these software installations. Note that I am performing the entire installation as the root user.
First, install MySQL by downloading the latest version from the MySQL Web site, which, as of this writing was version 3.23.49. This file will be placed in my home directory at /home/slowe/slash/mysql-3.23.49.tar.gz. Table A describes the steps for Installing MySQL.
On my Red Hat Linux 7.2 server, Perl 5.6.0 is already installed. For most recent Linux servers, an acceptable version of Perl (5.005_03 or above) will already be installed. However, I highly recommend upgrading to Perl 5.6.1 before you even think about moving on to the next step. I attempted multiple installations using Perl 5.6.0 and CPAN insists on upgrading Perl at the end of the installation, rendering many of the installed libraries useless. If you upgrade to Perl 5.6.1 before moving on, you will find that the remainder of the installation goes much more smoothly.
Table B shows the easiest way to upgrade to Perl 5.6.1 using CPAN.
|perl -MCPAN -e shell||Enters the Perl CPAN command shell|
|cpan> quit||Exits CPAN|
|/sbin/init 6||Reboots the machine|
After initially entering the CPAN command shell, you will be asked for configuration information. Accept all of the default answers, which should work fine for a Slash installation. After the setup, you may have to wait while CPAN downloads the Perl Bundle::libnet package and installs it. During this installation, you will be asked for geographic information and asked to pick FTP servers from a list. At this point follow the instructions on the screen. In my case, the Bundle::libnet package was upgraded, followed by the Perl upgrade. The Perl upgrade from 5.6.0 to 5.6.1 took some time, and I had to answer questions about my installation.
Apache and mod_perl
Installing MySQL and Perl for Slash was fairly simple. Apache and mod_perl, which is the Apache module for Perl, is another story. Slashcode requires a specific set of installation steps for these two components in order to function properly.
First, download Apache. As of this writing, the latest 1.x version of Apache is 1.3.24 and the file name is apache_1.3.24.tar.gz, which I have saved in /home/slowe/slash. The mod_perl 1.26 (mod_perl-26.tar.gz) file also needs to be downloaded. The mod_perl file is also placed in /home/slowe/slash.
After this is done, carefully follow the steps shown in Table C (substituting your own directory for mine). This installation looks very complex because it is. Unfortunately, without running all of these steps, Slashcode will never work.
With these software installations out of the way, it’s time to move onto the main event: installing Slashcode. First, get the Slashcode package. (As of this writing, Slashcode is at version 2.2.5). For my installation, I downloaded the Slashcode distribution into /home/slowe/slashcode. Follow the instructions in Table D to properly install Slashcode.
|cd /home/slowe/slash||Switches to the Slashcode download directory|
|gunzip -dc slash-2.2.5.tar.gz | tar xvf -||Unpacks the Slashcode distribution archive|
|cd slash-2.2.5||Switches to the Slashcode source directory|
|make install||Installs Slashcode|
I ran into problems during this part of the installation because of modules that were not properly installed during the CPAN Bundle::Slash installation. Manually downloading and installing the libraries in question easily rectified these problems. The problem library was DBIx::Password. I found that Bundle::Slash was not installing because the DBD::mysql supporting module was not installing properly. Because MySQL files were not in the location that Perl expects to find them on a Red Hat system, DBD::mysql was not installing properly. Since DBD::mysql is essential to Slash, I had to manually install DBD::mysql without using CPAN by downloading the source distribution to /home/slowe/slash. Then I followed the steps shown in Table E.
When completed, this default Slashcode installation installs into /usr/local/slash and assigns the nobody user and group as the owner of its files. An Apache configuration file is also created and is needed in order for Apache and Slashcode to work together. For my installation, I included this file in my Apache configuration with the following commands:
At the end of the file, I inserted the line:
Install a Slash site
With Slash installed and configured, you can create your first Slash site. To use the command that Slash has included for this purpose, you’ll need the name of the virtual user that you created in the DBIx::Password installation above. I used mysql, therefore I will use the following command to create my Slash site.
[root@dhcppc4 bin]# ./install-slashsite -u slash
Listing A shows the question and answer session that I had to go through to get this site functional.
For my installation, I had to tell Apache where to look for this Slash site because the Apache default document directory was not located where Slash installs its files. To do this, I opened up /usr/local/apache/conf/httpd.conf (in my favorite text editor, Pico) and changed the line marked DocumentRoot to /usr/local/slash/site/dhcppc4/htdocs. Where did I get this configuration? During the Slash site installation, Slashcode created a configuration file named /usr/local/slash/site/dhcppc4/dhcppc4.conf, which had the values required for portions of the httpd.conf file. For my setup, the only two changes required to the Apache httpd.conf file were the addition of the Include directive and the relocation of the document root. Once I made this last change, I restarted Apache with the following two commands:
For everything to work properly, I also needed to make sure that the machine named dhcppc4 was in my DNS or hosts file on the client machines.
Did it work? There’s only one way to find out. I browsed to http://dhcppc4. Figure A shows the default Slash site, which means it worked!
|My Slash site is up and running|
Is it all worth it?
The installation of a Slash site is very difficult, to say the least. In comparison to many other applications (such as Adaptive Website Framework, Dreamweaver, and FrontPage) Slashcode will challenge your installation knowledge to its fullest. But is going through all of this pain worth getting a Slash site up and running? I can answer this with a hearty YES. To see how powerful this technology can be, all you need to do is visit Slashdot. Slashcode allows an enormous amount of users to post, reply, and read a great deal of user-driven content.
Slashcode won’t get your e-commerce site up and running, but it will help you offer employees, vendors, or customers a very flexible and user-friendly location to find and post information.