Install Slash For Dummies
Slashcode Installation Guide
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
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.
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.
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.
- It's of note, I believe, to state that I never got slash working until I installed my distro without perl. I've read on many mailing lists that you can still upgrade your perl if it was packaged base, but after 2.5 weeks I gave up. You have been warned.
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.
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.
- NOTE!!! Please do not set a root MySQL password until the installation of slash is complete. You will run into Bundle::Slash errors later. This is fixable (and I have listed such a fix), but it is not recommended and will greatly increase your install time. (Thanks Wil D.)
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.
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
make test
if the perl modules
are not yet installed. Don't panic, this is normal. Some needed perl modules will not install
without Apache and mod_perl installed. That's fine, ignore all errors and/or
warnings given by make test. Now, if
you get errors that prevent the final make install
from completing properly, then you have a problem. I'm not sure what
those problems may be, be sure to look around the web (groups.google.com
is a good place to start) featuring your specific error message in hopes to
resolve them. This document can't help you any more than that.
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] 1Do 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] yWhere 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] localhostUser name for connecting to database slashdb? [undef] slashuser
Password for connecting to database slashdb? [undef] slashpass
Creating files for MySQL ..........................
- NOTE!! Watch carefully as the module make's and installs itself. Look for these two potential errors when "make test" is running:
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% okayIf 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.
- NOTE!! This error is caused by issuing a root password for MySQL access. Fixes:
- Please remove the password by issing the FLUSH PRIVILEGES command in a mysql> prompt. (Thanks Wil D.)
- Reset MySQL by running "./etc/rc.d/init.d/mysql restart" (Thanks Wil D.)
- Do a "force install Bundle::Slash" after Bundle::Slash has installed the rest of the modules. This will unfortunately force Bundle::Slash to compile, test, then install every single module (thanks to Mysql-modules being a core component to the package), but it will allow you to keep the root password intact. (Thanks Stephen T.)
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.
- NOTE!! After Bundle::Slash completes itself, pay close attention to any problems it might have encountered. If, for example, it says at the end of the install it had problems install Email::Valid, enter the command "install Email::Valid". If this install errors out for some reason or other (ie, will not install), force it to install by entering "force install Email::Valid". Most to all packages can be forced this way. This is not recommended, this is merely showing you how to get them to work if you are dead-set determined, as I was, to get slash up and running.
- NOTE!! If you do not have sendmail installed, the Mail::Sendmail package install test may take at least 5 minutes until it times out. Do not break the install (Ctrl + C). Let it finish installing or slash will not run. This may also cause the Email::Valid package error I was referring to, as well as other problems. It is recommended that you have sendmail installed on your machine. You'll find sendmail in all its glory at http://www.sendmail.org/. I would suggest using a packaged binary release such as RPM or .DEB.
- NOTE!! LWP may error out during the "make test" phase of the package install. The problem may lie with your hostname so try and correct the problem by entering "hostname localhost" at a bash (root@your_computer_name#) prompt, then attempting another installation. (Thanks Stephen T.)
- NOTE!! DBD::mysql may error out thanks to bad username/password setups in the Makefile.PL for the package. This may also effect DBIx::Password, causing this module not to install as well. Be careful to watch after the Mysql-modules package has been installed for all messages pertaining to possible installation problems. If these errors should occur you can M"force install" the packages, though if your slash doesn't compile/function/operate correctly, this may attribute to that. (Thanks Stephen T.)
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.
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.
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!
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.
Any and all questions, comments, updates, or fixes to this document should be directed toward evan@misterorange.com.