Main Menu
Search
Login
Username:

Password:


Lost Password?

Register now!
Daniel's Wiki - Installation on Slackware 12.0 (en)

!!!THIS IS NOT READY FOR USE YET.

Building and installing VHCS on Slackware 12.0

I'm starting with the text from the 10.x page and will expand on it. For a lot of places I'm not going to make any changes yet.

Software Requirements

To run VHCS you must have the following software daemons installed
  • Bind ( *1 )
  • MySQL (Version 4 or greater) ( *3 )
  • iptables ( *1)
  • Postfix (Version 2 or greater) ( *2 )
  • Apache (Version 2 or greater) ( *2 )
  • Courier POP3 and IMAP ( *2 )
  • ProFTPd (Slackware provided ( *3 )

*1 Included with Slackware 12.0 and works fine with VHCS.
*2 Not included with Slackware 12.0. I built it from source.
*3 Included with Slackware 12.0, but I would like to compile it differently than the default.

For the packages not supplied with Slackware or the ones not compiled in a format compatible with VHCS I have built my own. I chose to do this by the way of SlackBuilds.
They are bash scripts that d/l and compile the source and turn it into a slackware package that can be installed using the normal package management.
You will need to d/l and install http://www.lunix.com.au/files/vhcs/slackbuilds-1.9-noarch-1jim.tgz before running any slackbuilds. You will also need to edit the conf file for the slackbuilds.
/etc/slack-package.conf

The scripts I used can be d/l from http://www.lunix.com.au/files/vhcs/

Slackware 10.2 Install

Coming Soon

Quotas

# vi /etc/fstab
add ",usrquota" after the line for "/" volume
# touch /aquota.user
# chmod 600 /aquota.user
# mount -o remount /
# quotacheck -avugm

Change / to /var if you /var on a seperate partition.

Mount doesn't read fstab, so you have to use:

  1. mount -o remount,usrquota /

or restart your machine after editing fstab (which ever).

Remove useless packages

Coming Soon

Install perl modules

This needs to be fixed up.

# install perl-libwww-perl perl-HTML-Parser perl-HTML-Tagset perl-URI \

perl-Crypt-Blowfish perl-Crypt-CBC perl-Date-Calc perl-MIME-tools \
perl-Convert-?BinHex perl-IO-stringy perl-?MailTools perl-?TimeDate Term::ReadPassword

Iptables

I feel that you should d/l and install shorewall. This is a great iptables frontend.

PostFix

wget http://www.lunix.com.au/files/vhcs/postfix.slackbuild.tgz
tar zxvf postfix.slackbuild.tgz
cd ./postfix
./SlackBuild ( this downloads and compiles postfix )

Courier authdaemon

wget http://www.lunix.com.au/files/vhcs/courier-authlib.slackbuild.tgz
tar zxvf courier-authlib.slackbuild.tgz
cd ./courier-authlib
./SlackBuild ( this downloads and compiles courier-authlib )

Proftpd

Slackware comes with Proftpd but it is not compiled with mysql so we need to re-compile it.

wget http://www.lunix.com.au/files/vhcs/proftpd.slackbuild.tgz
tar zxvf proftpd.slackbuild.tgz
cd ./proftpd ./SlackBuild ( this downloads and compiles proftpd with mysql )

Configure & Start Services

add execute permissions to init scripts. Comming Soon.

Patches (are these needed?)

# ln -s /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so /lib/
# cp -p /usr/local/courier/rfc822/rfc822.h /usr/local/include/

PHP mcrypt

http://phprpms.sourceforge.net/mcrypt

wget http://umn.dl.sourceforge.net/sourceforge/phprpms/php-mcrypt-4.3.9-3.1.1.i386.rpm
rpm -Uvh php-mcrypt-4.3.9-3.1.1.i386.rpm

If the rpm command gives an error about libmcrypt that's needed, execute:

yum install libmcrypt.i386 libmcrypt-devel.i386

Then retry the command.

Create vhcs2 database

HISTFILE= keeps the mysqladmin password out of your bash history

# HISTFILE=
# mysqladmin password ******
# mysql -u root -p ******
create database vhcs2;
exit;

VHCS2

Download from http://www.vhcs.net Extract the installation files to a secure directory.

cd /root
tar -xjpvf vhcs-x.x.x.tar.bz2

Change to the newly created directory.

cd vhcs-x.x.x/configs/

edit vhcs2.conf before install
(only differences are shown)
SERVER_HOSTNAME = ****
BASE_SERVER_IP = X.X.X.X
MR_LOCK_FILE = /var/run/vhcs2.lock
DATABASE_NAME = vhcs2
DATABASE_PASSWORD = ****
BIND_CONF_FILE = /etc/named.conf
BIND_DB_DIR = /var/named/chroot/var/named
APACHE_CMD = /etc/init.d/httpd
APACHE_NAME = httpd
APACHE_LOG_DIR = /var/log/httpd
APACHE_USERS_LOG_DIR = /var/log/httpd/users
APACHE_BACKUP_LOG_DIR = /var/log/httpd/backup
APACHE_CONF_FILE = /etc/httpd/conf.d/vhcs2.conf
APACHE_USER = apache
APACHE_GROUP = apache
MTA_SASLDB_FILE = /etc/sasldb2
CMD_NAMED = /etc/init.d/named
CMD_HTTPD = /etc/init.d/httpd
CMD_AUTHD = /etc/init.d/courier-authlib
CMD_IMAP = /etc/init.d/courier
CMD_POP = /etc/init.d/courier
CMD_VHCS2D = /etc/init.d/vhcs2
MAIL_TRAFF_LOG = maillog

Modify the /usr/lib/postfix entry in main.cf to reflect installed directory in Centos

sed -i "s#/usr/lib/postfix#/usr/libexec/postfix#g" configs/postfix/main.cf

Change to the newly created directory.

cd ../vhcsx.x.x

Now You have to make build for your system

make install

Your build is now stored in /tmp/vhcs2

Copy all directory from the build into your system (do not forget to make backups)

# cp -R /tmp/vhcs2/* /

# cp -a /etc/courier/userdb /etc/authlib/userdb
# makeuserdb

setup:

# cd /var/www/vhcs2/engine/setup/
# ./vhcs2-setup
hostname: ****
system network address: ..*.*
SQL server host: localhost
SQL user: root
SQL password: *******
admin name: admin
admin password: *******
admin e-mail: X@X.X

VHCS uses nogroup for Proftpd

Change this to nobody

sed -i "s/nogroup/nobody/" /etc/proftpd.conf

Patches

# chmod u+w -R /var/www/vhcs2/gui/tools/webmail/

(Probably optional)

# cd /etc/vhcs2/bind/parts/
# cp -p cfg_entry.tpl cfg_entry.tpl.bak
# vi cfg_entry.tpl
original line: file "{DB_DIR}/{DMN_NAME}.db";
replacement line: file "{DMN_NAME}.db";
# vi /var/www/vhcs2/engine/vhcs2-*
replaced all "0700" with "0755" for domain and e-mail creation
# touch /etc/sasldb2
(test with /usr/sbin/sasldblistusers2)

Startup Script

Maybe someone can put this in a file and host it somewhere people can download it?

# vi /etc/init.d/vhcs2

#!/bin/sh
#
# vhcs2           Start or stop the vhcs2 daemon
#
# chkconfig: - 95 5
# processname: vhcs2
# description: Start or stop the vhcs2 daemon
#

name='vhcs2'
lockfile=/var/lock/subsys/vhcs2
confFile=/etc/vhcs2/vhcs2.conf
pidFile=/var/log/vhcs2/vhcs2.pid
daemon=/var/www/vhcs2/daemon/vhcs2_daemon
name=vhcs2_daemon

case "$1" in
    'start')
    $daemon >/dev/null 2>&1 </dev/null
    RETVAL=$?
    if [ "$RETVAL" = "0" ]; then
        touch $lockfile >/dev/null 2>&1
    fi
;;
'stop')
pidfile=`grep "^pidfile=" $confFile | sed -e 's/pidfile=//g'`
kill `cat $pidfile`
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
    rm -f $lockfile
fi
;;
'status')
pidfile=`grep "^pidfile=" $confFile | sed -e 's/pidfile=//g'`
if [ "$pidfile" = "" ]; then
    pidfile=$pidFile
fi
if [ -s $pidfile ]; then
    pid=`cat $pidfile`
    kill -0 $pid >/dev/null 2>&1
    if [ "$?" = "0" ]; then
        echo "$name (pid $pid) is running"
        RETVAL=0
    else
        echo "$name is stopped"
        RETVAL=1
    fi
else
    echo "$name is stopped"
    RETVAL=1
fi
;;
'restart')
$stop && $start
RETVAL=$?
;;
*)
echo "Usage: $0 { start | stop | restart }"
RETVAL=1
;;
esac
exit $RETVAL

# chmod +x /etc/init.d/vhcs2
# chkconfig --add vhcs2

Start VHCS2 daemon

# service vhcs2 start

Access to VHCS2

# http://your_server_ip/vhcs2/

References

Old Centos Wiki http://wiki.vhcs.net/en/index.php/Installation_CentOS_4.x

Longer instructions in post #5 (taken from the Fedora Install notes) http://vhcs.net/new/modules/newbb/viewtopic.php?topic_id=2854&forum=2&post_id=14289

Partitioning schemes http://vhcs.net/new/modules/newbb/viewtopic.php?topic_id=3125&forum=2 http://www.owlriver.com/tips/partitioning-strategy/

Securing PHP http://vhcs.net/new/modules/newbb/viewtopic.php?topic_id=2714&forum=2