Slash-SME-HOWTO


Placido Sanchez
http://www.geocities.com/lapsch
Updated: 4-02-02

If anyone finds an error or/and a correction, or something that needs to be added, please email me.

What is slash?
Slash is a database-driven news and message board, using Perl, Apache and MySQL. It uses persistence through mod_perl for a good speed and efficiency. Slash has all the features and more that you'd ever want in a bulletin-board/message-board system. You can customize it to anything you want, give it any appearance that you want. This can mostly be done via data in the database. Slash is a database beast in the true sense.
http://slashcode.com/

Updates:

WARNING:
The instructions below work for me, it might not work for you. Install at your own risk.

READ THE SLASHCODE INSTALL FILE A COUPLE OF TIMES.
It will help you understand the installation process better.

Known problems and Solutions
Apply solutions at the end, unless indicated.

  1. When 'signal-event' occurs and Apache is restarted, slash seems to die.
    • A link to 'slash' needs to be in the 'event' directory (after mysql and httpd), so slash also restarts.
      If someone can find a better solution let me know.
      1. Download http://www.geocities.com/lapsch/tgz/SlashEvents.pl.gz and gunzip it then run it: perl SlashEvents.pl
      2. This checks if apache is not running, so it can start it if needed
        pico +48 -w /etc/init.d/slash
        Look for start), insert the text thats bold and red below at the next line.
           start)
                perl -e '
                        $i=`/etc/init.d/httpd-e-smith status`;
                        chomp($i);
                        if($i=~m/(dead|stopped)/i)
                        {
                        system("/etc/init.d/httpd-e-smith start");
                        }
                        '
              cd $DATADIR
        
  2. slash.conf needs to be put in httpd.conf more correctly
    • I'm not an expert with httpd.conf, but I figure something out.

IMPORTANT MAKE SURE THE SME SERVER NAME IS slash, SSH TO THE SERVER AND su admin CONFIGURE THE SERVER AND CHANGE THE NAME IF YOU NEED TO.

Create a temp dir for working
mkdir /root/SLASH
cd /root/SLASH

Files To Download
Slash, Apache, mod_perl Source
5 = Files for SME 5.0 + Update3 only
51 = Files for SME 5.1.2 only
http://perl.apache.org/dist/mod_perl-1.26.tar.gz
http://prdownloads.sourceforge.net/slashcode/slash-2.2.5.tar.gz
ftp://ftp.e-smith.org/pub/e-smith/releases/5.1.2/SRPMS/apache-1.3.22-3.7.1es.src.rpm

Needed by Slash, Apache, mod_perl to compile
ftp://speakeasy.rpmfind.net/linux/redhat/7.1/en/os/i386/RedHat/RPMS/zlib-devel-1.1.3-22.i386.rpm
ftp://speakeasy.rpmfind.net/linux/redhat/updates/7.0/en/os/i386/expat-1.95.1-1.i386.rpm [ 5 ]
ftp://ftp.redhat.com/pub/redhat/redhat-7.1-en/os/i386/RedHat/RPMS/expat-devel-1.95.1-1.i386.rpm
ftp://speakeasy.rpmfind.net/linux/redhat/updates/7.0/en/os/i386/mm-1.1.3-2.i386.rpm [ 5 ]
ftp://speakeasy.rpmfind.net/linux/redhat/updates/7.0/en/os/i386/mm-devel-1.1.3-2.i386.rpm
ftp://speakeasy.rpmfind.net/linux/redhat/7.1/en/os/i386/RedHat/RPMS/db3-devel-3.1.17-7.i386.rpm
ftp://speakeasy.rpmfind.net/linux/redhat/updates/7.0/en/os/i386/openssl-devel-0.9.6-9.i386.rpm

Needed for compiling
http://www.geocities.com/lapsch/rpms/kernel-headers-2.2.19-7.0.8.noarch.rpm
http://mirror.nblug.org/redhat/updates/7.0/en/os/i386/kernel-source-2.2.19-7.0.8.i386.rpm
ftp://speakeasy.rpmfind.net/linux/redhat/updates/7.0/en/os/i386/cpp-2.96-85.i386.rpm [ 5 ]
ftp://ftp.rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/cpp-2.96-98.i386.rpm [ 51 ]
ftp://speakeasy.rpmfind.net/linux/redhat/7.1/en/os/i386/RedHat/RPMS/make-3.79.1-5.i386.rpm [ 5 ]
ftp://ftp.rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/make-3.79.1-8.i386.rpm [ 51 ]
ftp://speakeasy.rpmfind.net/linux/redhat/7.1/en/os/i386/RedHat/RPMS/glibc-devel-2.2.2-10.i386.rpm [ 5 ]
http://tigger.smu.edu.sg/software/updates.redhat.com/i386/glibc-devel-2.2.4-19.3.i386.rpm [ 51 ]
ftp://speakeasy.rpmfind.net/linux/redhat/updates/7.0/en/os/i386/gcc-2.96-85.i386.rpm [ 5 ]
ftp://speakeasy.rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/binutils-2.11.90.0.8-9.i386.rpm [ 51 ]
ftp://speakeasy.rpmfind.net/linux/redhat/7.2/en/os/i386/RedHat/RPMS/gcc-2.96-98.i386.rpm [ 51 ]

Needed by Slash

This modules are not in Bundle::Slash and/or are recommended to compile manually and/or be install early.

Things that need to be install so the instructions below work.
Install these in this order, rpm -Uvh each of these files.
zlib-devel-1.1.3-22.i386.rpm
expat-1.95.1-1.i386.rpm  [ 5 ]
expat-devel-1.95.1-1.i386.rpm
mm-1.1.3-2.i386.rpm  [ 5 ]
mm-devel-1.1.3-2.i386.rpm
db3-devel-3.1.17-7.i386.rpm
openssl-devel-0.9.6-9.i386.rpm

Install these in this order, rpm -Uvh each of these files.
cpp-2.96-85.i386.rpm [ 5 ]
cpp-2.96-98.i386.rpm [ 51 ]
make-3.79.1-5.i386.rpm [ 5 ]
make-3.79.1-8.i386.rpm [ 51 ]
kernel-headers-2.2.19-7.0.8.noarch.rpm
kernel-source-2.2.19-7.0.8.i386.rpm
glibc-devel-2.2.2-10.i386.rpm [ 5 ]
glibc-devel-2.2.4-19.3.i386.rpm [ 51 ]
gcc-2.96-85.i386.rpm [ 5 ]
binutils-2.11.90.0.8-9.i386.rpm [ 51 ]
gcc-2.96-98.i386.rpm [ 51 ]

Don't know exactly what this does, but it fixes some things.
Make sure that /usr/src/linux is a symbolic link to /usr/src/linux-2.2.19
Don't do this if you have an SMP machine, you'll do it later.
cp -a /usr/src/linux/include/linux /usr/include
cp -a /usr/src/linux/include/asm-i386 /usr/include/asm

1. MySQL
pico /etc/rc.d/init.d/mysqld

Look for these lines below (about line 23)
prog="MySQL"

start(){

Replace the emptly line with this below
TZ=GMT
export TZ

You should end up with this below
prog="MySQL"
TZ=GMT
export TZ

start(){

Remember this information below, you'll need it later.

Create a database to be used by Slash. I will create a database name 'slash'.
mysqladmin create slash

Now you need to create a user to access the database. I will also use 'slash' as the username. I will use 'password' as the password for user 'slash'. If you will use another user modified 'slash@localhost' to 'YOURUSER@localhost'. If you used another database name, modified 'slash.*' to 'YOURDATABASENAME.*'
mysql

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 105 to server version: 3.23.36
Type 'help;' or '\h' for help. Type '\c' to clear the buffer

mysql> GRANT SELECT,INSERT,UPDATE,ALTER,DELETE,CREATE,DROP,INDEX \
       ON slash.* TO slash@localhost IDENTIFIED BY "password";
Query OK, 0 rows affected (0.04 sec)

mysql> exit

restart MySQL
/etc/rc.d/init.d/mysqld stop
Stopping MySQL:                                            [   OK   ]
/etc/rc.d/init.d/mysqld start
Starting MySQL:                                            [   OK   ]

2. Apache and mod_perl
rpm -Uvh apache-1.3.22-3.7.1es.src.rpm


ONLY if you have an SMP machine

make sure that /usr/src/linux is a symbolic link to /usr/src/linux-2.2.19

cd /usr/src/linux
cp configs/kernel-2.2.19-i386-smp.config ./.config
make oldconfig
make dep
cp -a include/linux /usr/include
cp -a include/asm-i386 /usr/include/asm
cd /root/SLASH

Compile Apache and mod_perl. Do exactly what's below, otherwise you might break SME.
tar zxvf /usr/src/redhat/SOURCES/apache_1.3.22.tar.gz
cd apache_1.3.22

patch -s -p0 < /usr/src/redhat/SOURCES/sslcfg.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.22-config.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.22-eapi-2.8.5.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache-1.3.11-apxs.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.22-phhttpd-eapi.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.20-db.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.14-mkstemp.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.14-redhat.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache_1.3.20-apachectl-init.patch
patch -s -p1 < /usr/src/redhat/SOURCES/apache.1.3.19.ProxyPass.resetTimeout.patch

cd ../
tar zxvf mod_perl-1.26.tar.gz
cd mod_perl-1.26

perl Makefile.PL APACHE_SRC=../apache_1.3.22 DO_HTTPD=1 USE_APACI=1 \
     PERL_MARK_WHERE=1 EVERYTHING=1 
make 
make install 

cd ../
cd apache_1.3.22

./configure \
--prefix=/etc/httpd \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--mandir=/usr/share/man \
--sysconfdir=/etc/httpd/conf \
--includedir=/usr/include/apache \
--libexecdir=/usr/lib/apache \
--datadir=/var/www \
--iconsdir=/var/www/icons \
--htdocsdir=/var/www/html \
--manualdir=/var/www/html/manual \
--cgidir=/var/www/cgi-bin \
--localstatedir=/var \
--runtimedir=/var/run \
--logfiledir=/var/log/httpd \
--proxycachedir=/var/cache/httpd \
--enable-module=all \
--enable-shared=max \
--enable-rule=EAPI \
--disable-rule=WANTHSREGEX \
--enable-module=auth_dbm \
--with-perl=/usr/bin/perl \
--enable-suexec \
--suexec-docroot=/var/www \
--suexec-caller=apache \
--activate-module=src/modules/perl/libperl.a 

make
make install
cd /root/SLASH


If you install perl-DBD-MySQL then perl-Msql-Mysql-modules is not needed.

rpm -Uvh perl-DBI-1.18-1.i386.rpm
rpm -Uvh perl-DBD-MySQL-1.2216-4.i386.rpm
rpm -Uvh perl-HTML-Tagset-3.03-3.i386.rpm 
 

tar zxvf DBIx-Password-1.8.tar.gz
cd DBIx-Password-1.8/

perl Makefile.PL
What is the name of the Virtual User?
slash
What is the dbi driver? (AKA mysql)
mysql
What is the name of the database?
slash
What is the name of the machine that the database is on?
localhost
Is the database on any special port(you should probably just hit return)?

What is the username?
slash
What is the password?
password
What attributes would you like to add?
(Enter nothing to skip or finish)

What is the name of the Virtual User?
(Enter nothing if you are finished adding users.)

Checking if your kit is complete...
Looks good
Writing Makefile for DBIx::Password


make 
make test
make install
cd /root/SLASH

Install needed perl modules.
If you are going to install all the needed modules manually go ahead and do it now (you find them at http://search.cpan.org), and skip this below. If you are are doing it the easy way run this below, but pay attention you might need to answer a couple of questions.
Sometimes you'll get lots of errors, just exit and try it again or you can download all tar.gz files manually and install them.

perl -MCPAN -e shell

Are you ready for manual configuration? [yes] no 
***Type 'no' above, unless you know what your doing.***

cpan> install Net::Cmd
cpan> install Bundle::Slash

When it tries to install Msql-MySQL, when you get something like below,
just hit CTRL+C. 
This does not need to be install, perl-DBD-MySQL works fine. 
======================================== 
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 
========================================

Once install Bundle::Slash works, exit and do it a couple more times,
just to make sure. When you see alot of "is up to date.", like below,
you can continue.
...
Compress::Zlib is up to date. 
Archive::Tar is up to date. 
File::Spec is up to date. 
Storable is up to date. 
MIME::Base64 is up to date. 
MIME::Base64 is up to date. 
Digest::MD5 is up to date. 
URI is up to date. 
Net::FTP is up to date. 
HTML::Tagset is up to date. 
...

Compile and install slash.
tar zxvf slash-2.2.5.tar.gz 
cd slash-2.2.5/
make
make install

......
+--------------------------------------------------------+
| All done.                                              |
| If you want to let Slash handle your httpd.conf file   |
| go add:                                                |
|                                                        |
| Include /usr/local/slash/httpd/slash.conf              |
|                                                        |
| to your httpd.conf for apache.                         |
| If not, cat its content into your httpd.conf file.     |
|                                                        |
| Thanks for installing Slash.                           |
+--------------------------------------------------------+
......
cd /root/SLASH

Create the the needed files for this to work on SME.
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/30AddModule60 \
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/30AddModule60
# Extra Modules
#AddModule mod_php.c
#AddModule mod_php3.c
#AddModule mod_perl.c

remove the # in front of #AddModule mod_perl.c
# Extra Modules
#AddModule mod_php.c
#AddModule mod_php3.c
AddModule mod_perl.c

pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/99IncludeSlash
Include /usr/local/slash/httpd/slash.conf

Rebuild httpd.conf
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

Restart Apache to make sure everything is alright.
/etc/init.d/httpd-e-smith restart
Stopping httpd:                                            [   OK   ]
Starting httpd:                                            [   OK   ]

Install your slash site
cd /usr/local/slash/
bin/install-slashsite -u slash

Select your slash site hostname
slash.something.xxx

User: nobody
Group: nobody

Select your plugins. I type 'a' for all plugins.

Then type the user name to control the site, I like to use 'admin'.

Now create a password for 'admin'

Provide an email address for 'admin'
                                                           
/usr/local/slash/site/slash.something.xxx/slash.something.xxx.conf

If you do not have your Slash site in the root of the web server (e.g.,
"http://www.example.com/mysite/" instead of "http://mysite.example.com/"),
you will need to adjust the rootdir, rdfimage, imagedir, absolutedir,
and cookiepath variables, as you also need to change your Apache config
appropriately.  These are all in the "vars" table of your database.

cd /root/SLASH

Restart Apache to make sure everything is alright.
/etc/init.d/httpd-e-smith restart
Stopping httpd:                                            [   OK   ]
Starting httpd:                                            [   OK   ]

Start Slash
/etc/init.d/slash start

So that Slash starts up when the machine is rebooted
IMPORTANT: 
MySQL needs to start before HTTPD and slash have started.
Change below if needed.
cd /etc/rc.d/rc7.d
mv S90mysqld S83mysqld

IMPORTANT: 
slash needs to start after MySQL and HTTPD have started. 
Change below if needed.
cd /etc/rc.d/rc7.d
ln -s ../init.d/slash S910slash

So that Slash stops when the machine is rebooted or shutdown.
IMPORTANT: 
slash needs to stop before MySQL and HTTPD.
Change below if needed.
cd /etc/rc.d/rc6.d
ln -s ../init.d/slash K10slash

So that each time something is change from the server-manager, slash doesn't stop working.

Download http://www.geocities.com/lapsch/tgz/SlashEvents.pl.gz
gunzip SlashEvents.pl.gz
perl SlashEvents.pl

This checks if apache is not running, so it can start it if needed
pico +48 -w /etc/init.d/slash

Look for start), insert the text thats bold and red below at the next line.

   start)
        perl -e '
                $i=`/etc/init.d/httpd-e-smith status`;
                chomp($i);
                if($i=~m/(dead|stopped)/i)
                {
                system("/etc/init.d/httpd-e-smith start");
                }
                '
      cd $DATADIR

Now just open a browser and go to http://slash.something.xxx. ENJOY!

If you want to install slash as your primary site (e.g. www.yourdomian.xxx) follow these instructions after you have done the above slash-primary.html

Hosted by www.Geocities.ws

1