#!perl -w # To check its syntax, run this document through perl. # To make it into plaintext at the standard location: # perldoc -tF docs/INSTALL.pod > INSTALL use Pod::Checker; podchecker(\*DATA); __END__ =head1 NAME INSTALL - Slash Installation =head1 SYNOPSIS This document describes how to install Slash, versions 2.2 and pre-releases of 2.3 and 2.5. For instructions on installation or upgrade of previous versions of Slash, see the INSTALL document included with those distributions. These instructions have only been tested on Linux. Installation under BSD and other Unix OSes is doable, with minor glitches (see L<"BSD Systems"> below). Windows is not supported. Slash can always be downloaded from SourceForge.net, from the FTP site, and via CVS. http://sf.net/projects/slashcode/ ftp://ftp.slashcode.com//pub/slashcode/ http://cvs.slashcode.com/ See the SourceForge.net page for patches and bug reports. =head2 Which version should I use? First of all: if you are using Slash 2.2.5 or before, including all 2.1.x, 2.0.x, and 1.x versions, you should upgrade to the latest version in the 2.2 tree, 2.2.6, as soon as possible. There are security issues with previous versions. You should not install previous versions. As of this writing (August 2006), our last official release (2.2.6) was long ago, and many features have been added since. All development has been in CVS. If you are installing a new Slash site, you don't want to use 2.2.6. And while you probably don't want to use the very latest CVS, you almost certainly do want to use the latest "R_" tag available in CVS. See L<"VERSIONS">, "CVS tags", below, for advice on choosing and maintaining a CVS installation. =head2 Read, then install We know you want to get right into the installation, but you must first read, carefully, these sections of this INSTALL file: =over 4 =item * REQUIREMENTS, to make sure you have the right hardware and software =item * "CVS tags," in VERSIONS, to make sure you have the right version of this code =item * SECURITY NOTES, to keep your system safe =item * INSTALLATION (the longest section), to make sure you will be able to finish what you start =back And it's a good idea to at least skim: =over 4 =item * INSTALLATION OPTIONS =item * TROUBLESHOOTING =back Read those sections before you begin actually performing the steps in L<"INSTALLATION">. This document also contains information on upgrading a Slash site (which can be tricky), and uninstalling (which is easy). =head2 Updates to this file This INSTALL file you are currently reading may not be the latest. Again, you probably don't want to upgrade your whole Slash checkout to the very latest CVS. But if you encounter problems, it might not be a bad idea to look over the very latest version of this INSTALL file, which you can find at: LEslashcode.cvs.sourceforge.netE*checkout*EslashcodeEslashEINSTALL> The version of this file that you are currently reading is: $Id$ If there are more recent versions of this file, you can find a list of those changes at: LEslashcode.cvs.sourceforge.netEslashcodeEslashEINSTALL> =head1 INSTALLATION =head2 Installation Note All of the installation steps below should be executed as root. If this is a problem, then Slash is probably not for you (see "Non-Root" below, under "INSTALLATION OPTIONS"). Type carefully. Now's a good time to back up anything important. =head2 Installation Procedure There are eight steps to installation. Anything already done can be skipped -- but only if you have the correct version and configuration, particularly with Apache/mod_perl. =over 4 =item 1. B If it is already installed, doublecheck that its version is at least the minimum required (see L<"REQUIREMENTS">). If you have questions about the installation process, please refer to MySQL documentation. Slash requires that your MySQL server run in the GMT timezome. Find your global my.cnf file (probably C or C), locate the C<[mysqld_safe]> (or C<[safe_mysqld]>) group, and add this line to it: timezone = GMT Start MySQL (it must be running for the installation of Slash and some perl modules). Or, if it is already running, restart MySQL (if you have other services using MySQL, you should probably stop and start them -- make sure they are timezone-agnostic!). Create a database to be used by Slash. Our default name is 'slash': CREATE DATABASE slash; Create a username/password that can access that database, and ensure that user has at least privileges to select, insert, update, delete, lock, create, drop, index and alter. For example, if your whole site (slashd daemon and apache) will run on the same machine as your mysql server, and you wanted to use the mysql username 'slash', you might: GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, CREATE, DROP, INDEX, ALTER ON slash.* TO 'slash'@'localhost' IDENTIFIED BY (quoted password); GRANT PROCESS ON *.* TO 'slash'@'localhost' IDENTIFIED BY (quoted password); In this case, 'slash' would also be the name of your MySQL user as described in L<"Types of Users"> below. You'll have to give your MySQL user to DBIx::Password when you install and configure it, so don't forget it. =item 2. B Perl is likely already installed on your machine; doublecheck that its version is at least the minimum required (see L<"REQUIREMENTS">). Also, check the "Libraries" (or "Debian libraries") section under L<"REQUIREMENTS">, below. You may need to install dev packages for not only perl but mysql and expat as well and now's a good time to take care of that. =item 3. B B. OK, that is not strictly true, but unless you really know what you're doing, just assume it's true. If you already have mod_perl installed, it is probably not configured properly to work with Slash and you will have to rebuild it. If you are using the provided httpd.conf file from the slash distribution, and find that Apache is giving you errors, chances are mod_perl is not installed correctly, and you need to build it from scratch. Not following this direction is one of the most common reasons we see for a Slash install not working. Of course, if you have your own Apache modules or build options, you will need to modify the instructions here appropriately. First, untar apache and mod_perl. Then, go to the mod_perl directory, and have mod_perl build and install apache for you: perl Makefile.PL APACHE_SRC=../where_you_have_apache/src \ DO_HTTPD=1 USE_APACI=1 PERL_MARK_WHERE=1 EVERYTHING=1 \ APACHE_PREFIX=/where_apache_will_be_installed make make test make install B: You may be unsuccessful with C if the perl modules are not yet installed. However, some perl modules will not install without Apache and mod_perl installed. If you wish, skip C, run C, install the perl modules in step 4, and then come back and run C here again to make sure everything is OK. B: If you know what you're doing, Slash will work with a DSO Apache. Be sure you're on the latest versions of Apache and mod_perl and remember PERL_MARK_WHERE=1 and EVERYTHING=1. B: See also "Other requirements" under L<"REQUIREMENTS">. B: In mid-2006 Ubuntu 6.x switched sh to point to dash instead of bash, which apparently breaks the above step (because dash's 'echo -E' isn't compliant enough for apache's 'configure'). We're looking into it, but for now apparently (temporarily) linking /bin/sh to /bin/bash during this step is a workaround. LElaunchpad.netEubuntuE+spec/dash-as-bin-sh> (Update: this appears to no longer be a problem, but if you encounter problems on Ubuntu, check where your /bin/sh points.) =item 4. B Slash is powerful and complex, and, rather than reinvent the wheel, it often relies on CPAN modules. Open-source code reuse has many advantages. One disadvantage is that installing all those modules can be tricky, as you may be about to find out. You could install each module in F by hand, but this would be time-consuming. Instead, you'll want to install the bundle C using CPAN. =over 4 B: =over 4 =item B It is possible that upon typing "install Bundle::Slash", you will have one or more modules fail to install on the first try. The rest of the modules will be successfully installed but some won't. In that case you will want to fix the problems and retype "install Bundle::Slash" to make sure everything proceeds smoothly. Once that command gives you just a long list of "Foo::Bar is up to date," you are done. Until that point, you are not done; you must resolve the errors. =item B If you have previously installed Bundle::Slash, you will want to install it again, but you will need to delete the existing version. Go to your F<.cpan/Bundle> directory (usually F<~/.cpan/Bundle/>) and remove F. =item B With some versions of the CPAN module, the module will try to download and install the latest version of perl. Watch what the module is doing; if it begins to download an entire perl distribution, interrupt it (hit ctrl-C) until it stops, then try again with the CPAN module. This should not be an issue in the latest version of Bundle::Slash. =item B Sometimes, you will be installing a newer version of a module that exists elsewhere on the system. You probably want to tell the CPAN module to automatically remove older files. To do that from the CPAN shell, type: cpan> o conf make_install_arg UNINST=1 And if you want that to be CPAN's default from now on, add: cpan> o conf commit =item B Some of the modules in Bundle::Slash require other modules. We have not put some of those other modules in Bundle::Slash because, if those requirements change in the future, we don't want to make future Slash sites install more than they have to. If you see this: ---- Unsatisfied dependencies detected during [FOO/Bar-1.23.tar.gz] ----- Foobar::Baz Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] That's normal; just hit return. If it annoys you to have to do this, edit the C field of your CPAN/Config.pm file. Or, just do this to change it to automatically follow dependencies and commit the change: cpan> o conf prerequisites_policy follow cpan> o conf commit =item B There are bugs in versions earlier than 1.00 that break our JS. Unfortunately, CPAN seems to prefer version 0.9 even though 1.00 is available. You may have to install a better version in CPAN by hand: cpan> install A/AD/ADAMK/Data-JavaScript-Anon-1.00.tar.gz =item B You must have certain libraries existing on your system before building, for Compress::Zlib, XML::Parser, DBI and DBD::mysql. See "Libraries" under L<"REQUIREMENTS">, below. =item B If running BSD, also install the BSD::Resource module. We have heard reports of minor problems running Slash on BSD, but you are welcome to try. See SLASH_PREFIX below, and after the install, doublecheck the init scripts. If you have to make changes to get it to work, send us patches or detailed bug reports please: we want to support the BSDs. =item B When installing DBIx::Password, you will be asked for various information, the same information used to create the database and database user in Step 1. First, you'll be asked for a B name, which will be the identifier for all of this data. You can just use the name of your site, or any other alphanumeric string. This string will be your "DBIx::Password virtual user" as described in L<"Types of Users"> below -- you will use this in other places, so don't forget it. Then you'll be asked for your DBI driver (mysql), the name of the database you CREATEd in Step 1, its machine (maybe 'localhost' or an IP number) and port, and then the MySQL user name you GRANTed privileges to in Step 1 and its password. Some perl modules you can hit return for defaults and they'll work. This isn't one of them. If you don't understand what you're doing here, don't fake it -- that's a common reason for Slash installations failing. =item B To read the README for any module, before or after installing: cpan> readme MODULE To read the documentation of any of the modules, once they have been installed, type C at the command line. See L for more information on installing perl modules. =back =back Now that you have read the above notes, you're ready to install the perl modules. To use the CPAN module, invoke the CPAN shell: perl -MCPAN -e shell (Or, you may have the program "cpan" already available, which does the same thing.) If this is the first time you've invoked CPAN, you will be asked to configure it. Note that CPAN works best if most or all of these helper programs are installed: bzip2 gzip tar unzip make curl lynx wget ncftpget ncftp ftp gpg. If your OS installation is very anemic and you lack most of them, you might ^C its questions, install the missing programs, and then re-invoke the CPAN shell to restart configuration. It's probably a good idea here to install the latest version of the CPAN module itself, along with all the helper modules it requires. This is an optional step but may make the rest of module installation easier: cpan> install Bundle::CPAN If you chose to do that, then afterwards, C the CPAN and reinvoke it. (The plain shell command "cpan" will probably now work.) Next, install some important networking modules. This is also optional but, if there are problems with these modules, you'll want to resolve them before moving on to the rest of the installation: cpan> install Bundle::LWP Make sure all those modules are installed and up to date before proceeding. Note that Net::Cmd has a history of being a little broken in its tests; if it fails on tests 8 and 9 of t/require, then it's OK; just do C and repeat C. On Mac OS X and possibly other operating systems, if LWP's live/https tests fail, C manually and retry. Assuming you chose to install the LWP, then after it's been configured successfully, again, C the CPAN and reinvoke it. Finally, you must install Bundle::Slash: cpan> install Bundle::Slash This will be a long process. Several modules will ask to be configured during this process. Here are some tips: =over 4 =item B Don't worry about the threading warning. Slash doesn't use threads. =item B See "DBIx::Password" under IMPORTANT NOTES above. =item B and B You will need C and C in your $PATH, and even if they are there, you will probably see the lengthy error that starts "Apache cannot spawn child processes as 'root'". This is because, ironically, Apache::Test's self-tests are a colossal pain to actually run (I take the option to skip them). And personally I just C which is lame but solves the problem. =item B