Install Slash For Dummies

Slashcode Installation Guide


This document is out of date and is here for archival purposes. Please go to installslash.org for the latest and greatest.

Thanks

- Evan


Change log:
7/13/02: More updates and fixes added, including OSX and Darwin specific errors/tips
7/12/02: Fixed a few errors; rewrote some troubleshooting tips
7/2/02: Updated w/ Redhat tips and more troubleshooting
6/29/02: Updated w/ new tips and troubleshooting
6/27/02: First published


SYNOPSIS

I've been a slashdot reader for a long time. I've always loved and respected the slash database/perl program that runs the site. So when I decided to download and install the slash package on one of my Redhat/Mandrake machines, I was sure the installation wasn't too daunting. It has instructions, right?

Well, two and a half weeks later I finally figure out (most of) the Rubik's cube that is installing slash. The installation directions are nice, but a bit...rushed. I found them incomplete and the answers to my questions seemed far, far away. Why hadn't anyone written detailed instructions on this?

Well, I figured if no one else would do it...

This document describes how to install Slash 2.2.x simply and easily using Mandrake/Redhat/Debian, utilizing kernel 2.4.x. It may work on older kernels, but as for these instructions, only 2.4.x is utilized. For instructions on installation or upgrade of previous versions of Slash, see the INSTALL document included with the slash distribution and/or see www.slashcode.com.


INSTALLATION

Installation Notes

Installation Procedure

There are eight steps to installation. Expect a standard installation to take anywhere from 30 minutes to 2 hours. Skip the parts where you are up to date concerning version numbers, but it wouldn't hurt to glance at them just in case.

  1. Install perl 5.6.1+

If you are not sure if perl is install or not, see if /usr/local/bin/perl is present. Also try and run a "rpm -e perl" and see if anything occurs. It is says that perl is not installed, you may proceed.

I'm only gonna say this once: You can't upgrade perl using the source distribution if your current perl install is packaged base. This means that if you have perl rpms installed, you need to uninstall them first using "rpm -e perl" before you compile perl 5.6.x.

Download the latest version of perl from CPAN here: http://www.cpan.org/src/stable.tar.gz. Gunzip and tar it using the directory structures. This command is:

tar -zxvf stable.tar.gz

A directory will be made using the name perl and whatever the version number is. For these instructions, its "perl5.6.1/"

cd perl5.6.1

run "sh Configure -de"    -- This will configure perl using the default settings. Unless you know what you are doing (and these instructions are for those who do not), the defaults work fine.

next run "make"

then "make install"

perl 5.6.1 should now be installed. Check and make sure you have /usr/local/bin/perl. If you have /usr/local/bin/perl5.6.1 then you need to remove perl using your favorite package manager and install using the source again. CPAN will not function correctly until you do so.

  1. Install MySQL

    For those who haven't installed installed MySQL on their systems yet, go to http://www.mysql.com/downloads/mysql-3.23.html and download version 3.23 (the required version for slash 2.2.5) in rpm if you can. The source is a bit of a hassle, and will not be covered here.

    You need to download three RPM packages:

    MySQL-server
    MySQL-client
    MySQL-devel

    The last package, MySQL-devel, the development libraries, is very important. You cannot run slash without it. Unfortunately the original install instructions don't mention this, but when configuring the DBD::MySQL perl package (we'll get to this later), you must have the libraries needed in the development RPM to compile correctly.

    Now use your favorite editor to modify the /usr/bin/safe_mysqld file. My favorite editor is the very simple pico (found at freshmeat), and so all commands regarding editing hereafter will reference this program.

    So run the command "pico /usr/bin/safe_mysqld"

    You'll see something like this:

# This should be executed in the MySQL base directory if you are using a
# binary installation that has other paths than you are using.
#
# mysql.server works by first doing a cd to the base directory and from there
# executing safe_mysqld
trap '' 1 2 3 15 # we shouldn't let anyone kill us
 

Now add the following lines to the file:

# This should be executed in the MySQL base directory if you are using a
# binary installation that has other paths than you are using.
#
# mysql.server works by first doing a cd to the base directory and from there
# executing safe_mysqld
TZ=GMT
export TZ
trap '' 1 2 3 15 # we shouldn't let anyone kill us
 

Save the file (Ctrl + O, Enter) and exit (Ctrl + X)

Now start MySQL. It probably started up when you installed the RPMs, but we're gonna make sure. Do the following:

cd /etc/rc.d/init.d

./mysql stop -- this will stop mysql if its running

./mysql start -- this will restart the server and implement the new time zone changes we just added to safe_mysqld

Now we have to create a database and a user for that database to be used by Slash. This is the easiest route that will create a user named "slashuser" using the password "slashpass" and the database "slashdb". This is not recommended for production use. This is simply showing you that these work in regards to the rest of this document and in getting slash to compile, install, and run correctly. Type the following commands:

mysql --user=root mysql

You'll get a ">" prompt in which to type in commands. Type these in:

>CREATE DATABASE slashdb;

>GRANT ALL PRIVILEGES ON slashdb.* TO slashuser@localhost IDENTIFIED BY 'slashpass';

>exit

Now you have the correct users, permissions, and databases in which to utilize MySQL in the running of slash.

  1. Install expat

    expat is a library of XML tools that slash needs to use its database correctly. In order to do compile and run slash correctly, you must get expat and install it.

    Go to http://sourceforge.net/projects/expat/ and download the expat-1.9x.tar.gz.

tar -zxvf expat-1.9x.tar.gz and then cd yourself into the directory.

Run ./configure This should only take a moment to ensure that your system is capable of installing expat. (Thanks Wil D.)

Now type make, after that has completed, make install. This shouldn't take very long at all. After this has completed, feel free to delete the directory and the compressed package--we won't need it any longer.
 

  1. Install Apache and mod_perl

    You MUST install mod_perl and Apache as directed here. No buts. For this HOWTO to function, you have to do it my way, the way that the slash INSTALL directions utilize. If you get this to work and want to play around, so be it. But if you don't follow these instructions slash won't function in regards to this HOWTO.

    Here's what you need to do. Firstly, head over to http://www.apache.org/dist/httpd/ and find the latest 1.3.x build in .tar.gz form. For this example we'll use apache_1.3.24.tar.gz. Download and save it in a directory of your choosing.

    Now go here: http://perl.apache.org/dist/ and grab the latest mod_perl build. For this example we'll use 1.27. Download and save in a directory of your choosing. The version used for this demonstration is mod_perl-1.27.tar.gz.

    Now tar -zxvf both the apache and mod_perl packages. Remember where you unzipped the apache directory. This is important. For this example, we'll use "/usr/download/apache_1.3.24" as our unzip directory for apache.

    do a cd mod_perl-1.2.7 to enter the mod_perl directory

    now run this command first just as I've typed it:

    perl Makefile.PL APACHE_SRC=/usr/download/apache_1.3.24/src DO_HTTPD=1 \

    Don't forget the slash (\) at the end. It's needed. Also note the apache directory and also make sure you have "/src" at the end. mod_perl needs the source to install the binaries correctly.

    This will give you a ">" prompt to enter more commands. Now type:

    >USE_APACI=1 PERL_MARK_WHERE=1 EVERYTHING=1 \

    Lastly, enter this:

    APACHE_PREFIX=/usr/local/apache

    We're using /usr/local/apache from here on out in these directions. Only change this unless you know what you're doing.

    After that completes we want to enter these commands one at a time, letting each one finish before starting the next:

    make
    make test
    make install

     

  2. Install the Perl modules

    The best way to do this is with the CPAN module. It was installed when we compiled perl 5.6.1.

    To use the CPAN module, invoke the CPAN shell by entering this command at a command prompt:

    perl -MCPAN -e shell

    If this is the first time you have ran it, just hit enter through all of the options you're not sure of. CPAN will probably ask what continent and then what country you are in. After choosing the correct area, it will ask you to pick what mirrors you would like to use for the module download, enter those closest to you, or, if you're not sure, type 21, 27 (my personal picks). Continue on until you get to a cpan> prompt.

    After it has been configured, we'll want to enter the command to uninstall old modules automatically. Enter this at the cpan prompt:

    o conf make_install_arg UNINST=1
     

    The first thing we need to install is a CPAN update to make sure your version is the current one. Most likely is it not.

    install Bundle::CPAN

    If at any time it asks you if you want to stop the installation to install required updates, always say Y to such questions.

    After CPAN has finished install, you will need to restart it. Type this:

    reload cpan

    Okay, now for the grunt work. Type this to install the XML Parser module:

    install XML::Parser

    Now we'll want to install the Net::Cmd module, as it is needed by slash:

    install Net::Cmd

    Now let's install the Telnet module before finally getting into slash:

    install Net::Telnet

    After these packages have been configured, install Bundle::Slash:

    install Bundle::Slash

    Many packages will install now, and a full list of them is included with the original slash INSTALL document if you're interested. However with this HOWTO I'm only concerned with you knowing what to input when certain packages are looking for certain information.

    While installing Bundle::Slash, you will see something similar to this when Mysql-modules is installed. My answers are bolded for your convenience:

CPAN.pm: Going to build J/JW/JWIED/Msql-Mysql-modules-1.2216.tar.gz

Which drivers do you want to install?

1) MySQL only
2) mSQL only (either of mSQL 1 or mSQL 2)
3) MySQL and mSQL (either of mSQL 1 or mSQL 2)

4) mSQL 1 and mSQL 2
5) MySQL, mSQL 1 and mSQL 2

Enter the appropriate number: [3] 1

Do you want to install the MysqlPerl emulation? You might keep your old
Mysql module (to be distinguished from DBD::mysql!) if you are concerned
about compatibility to existing applications! [n] y

Where is your MySQL installed? Please tell me the directory that
contains the subdir 'include'. [/usr] /usr

* This is why it was very important to install the MySQL-devel RPM. Make sure that you input /usr there.

Which database should I use for testing the MySQL drivers? [test] slashdb

On which host is database slashdb running (hostname, ip address
or host:port) [localhost] localhost

User name for connecting to database slashdb? [undef] slashuser

Password for connecting to database slashdb? [undef] slashpass

Creating files for MySQL ..........................

t/akmisc...........FAILED test 44
Failed 1/351 tests, 99.72% okay
t/dbdadmin.........ok
t/mysql2...........ok
t/mysql............FAILED test 23
Failed 1/68 tests, 98.53% okay

If you have setup your MySQL database to not accept anonymous users, these errors will occur and hence stop the installation of the required MySQL modules.

 

After MySQL-modules have finished installing, the DBIx::Password package will begin its installation with this question:

What is the name of the Virtual User?

From this point on, you can fill in these answers and commands as written to install properly, beginning with the name of the Virtual User:

virtslash
mysql
slashdb
localhost
<just hit Enter>
slashuser
slashpass
<just hit Enter>
<just hit Enter>

If it asks you do you want to run the DBIx::Password tests, enter N. You do not want to run these, because a) they're not important, and b) they probably won't work anyway.

  1. Install Slash

    Firstly you have to attain slash. You'll find it at http://sourceforge.net/projects/slashcode/. Download the latest version and copy it to the directory of your choice. Remember I'm using slash2.2.5 for these instructions. Then run the tar -zxvf command on the compressed file and then cd yourself into the newly created directory.

    Okay, with that out of the way, type the following in the slash-2.2.5 directory:

    make GROUP=nogroup
    make GROUP=nogroup install

    When both of these have completed, a new configuration file for Apache will be created at /usr/local/slash/slash.conf. We need to insert a link to this file in your httpd.conf (apache configuration) file in order for your site to work correctly. For this to happen, enter this command:

    echo 'Include /usr/local/slash/httpd/slash.conf' >> /usr/local/apache/conf/httpd.conf

    Make sure you only do this once. If you do it twice, slash will break on you at some point or not run at all.

    To make sure it only went in once, you can do this:

    pico /usr/local/apache/conf/httpd.conf

    The line "Include /usr/local/slash/httpd/slash.conf" will appear at the end of the file, and should only appear once. Delete any other copies of this line.

     

  2. Install your Slash site

    Now for the big show. Let's install your slashsite and get it running!

    Do a  cd /usr/local/slash/bin and run the following:

    ./install-slashsite -u virtslash

    The program will prompt for answers to several configuration questions. Answer these questions. Don't worry too much about the first question, which will ask for your host name (ie, www.slashdot.org). If you are installing this as instructed, you can put just about anything in there. There is no set name that will or will not make it work.

    Pay attention to the user that slash will use to run slashd. This is set to default to "nobody". Hit Enter here.

    It will ask what group to use. It will default to nogroup. Just hit Enter to accept this default.

    Don't worry about the other questions, just make sure that when you are asked to set an administrator account that you note the name of the account, and the password.

    When its finished, another configuration file will be created at:

    /usr/local/slash/your_site_name/your_site_name.conf

    Your /usr/local/slash/httpd/slash.conf should automatically include this new configuration file, so no more httpd.conf additions are necessary. Translation? You don't need to do anything else here.

     

  3. Start your slash!

    After install-slashsite has completed, you are practically finished. Only a couple of steps before you see the elusive test page.

    First, we need to stop and start apache. Do not restart it. You must stop and start the apache binary like this:

    cd /usr/local/apache/bin
    ./apachectl stop
    ./apachectl start

    Now we'll run the slash daemon, slashd, the last step in our installation.

    cd /etc/rc.d/init.d/
    ./slash start

    That's it! You have officially finished your slash installation. Now start your favorite web browser and point it to yourself:

    http://localhost

    The hostname you entered will suddenly appear and the slash test page will now be displayed. At the login on the right, enter the administrator username and password you setup earlier using install-slashsite. After installing there you have complete control over slash and all content therein.

    Have fun!


TROUBLESHOOTING

PerlHandler Errors

You've got two seperate versions of mod_perl running on the same machine, and apache isn't sure what to use. Remove the old mod_perl package and install 1.27 using the apache source as indicated.

"Order" or other common <Directory> httpd.conf errors when starting apache

Apache is using the old version of itself and possibly mod_perl. You probably have two installs of apache, a packaged one and the source build we created. You need to make sure that the old installs of apache are completely gone (I'm not exactly sure how to do this) before installing slash.

"Can't locate *.pm in @INC" Errors

You haven't installed all of your CPAN modules correctly or they errored out instead of compiling properly and/or your perl version is old. Go back and repeat the CPAN instructions and pay close attention to any and all error messages and/or any "could not make install" errors. For these packages either you need to fill their requirements and/or do a "force install" for the appropriate package.

NOTE: You could also get these from having two different versions of perl installed on the same machine, where slash isn't sure which version to use.

Slash.pm Errors

You haven't "make install"-ed your slash2.2.5 yet. Go into your slash2.2.5 directory that you downloaded and give it a "make GROUP=nogroup install" to successfully install the packages.

NOTE: You could also get these from having two different versions of perl on the same machine and/or errors when trying to install slash2.2.5.

Invalid DBIx::Password Virtual User

You must go into the CPAN build directory for DBIx (this is the guideline for the correct directory to look in):

cd /root/.cpan/build/DBIx-Password-1.x

Now run this command:

perl Makefile.PL

After this completes, run this command to install the package (and overwrite any previous installations):

make install

Invalid command 'SlashVirtualUser'

Plain and simple: You included your site file (remember this? /usr/local/slash/your_site_name/your_site_name.conf), in your /usr/local/apache/conf/httpd.conf (apache configuration) file. All you need to do is run this command:

echo 'Include /usr/local/slash/httpd/slash.conf' >> /usr/local/apache/conf/httpd.conf

and/or check your /usr/local/apache/conf/httpd.conf file to make sure that only one copy of that Include directive is in there.


Updates to this Guide

Any and all questions, comments, updates, or fixes to this document should be directed toward evan@misterorange.com.