SysCP on SuSE 9.3 Professional

1. Introduction

This HowTo describes a possible way to install SysCP 1.2.10 on a SuSE 9.3 Professional server. The author used a SuSE 9.3 Professional minimal network installation as basis for this document.

2. Software Packages

The following software packages were installed using YaST. All dependencies had been resolved using the autoresolve feature of YaST, or the selected package is listed below.

The author listed the needed packages per daemon which is used, therefore some packages may be double-listed. The listed packages are the packages the author needed to install and/or compile the daemons, you may need some additional packages but YaST or rpmbuild will tell you. The author would welcome notes about what packages you had to install additionally.

General Apache + PHP MySQL Bind
wget apache2 mysql bind
webalizer apache2-prefork php4-mysql bind-chrootenv
apache2-mod_php4
PAM_MySQL Courier-IMAP ProFTPd
gcc courier-imap (SRPM) unzip glibc-devel
mysql-devel openldap2-devel autoconf pam-devel
gcc-c++ libstdc++-devel zlib-devel fam
glibc-devel cyrus-sasl-devel automake gcc
libstdc++-devel gdbm-devel expect mysql-devel
pam-devel glibc-devel fam zlib-devel
zlib-devel openssl-devel fam-devel
ncurses-devel gcc
patch gcc-c++
rcs bison
strace libtool
syslogd cvs
texinfo m4
unzip pam-devel
mysql-devel flex
tcl vim

3. SysCP Webfrontend

Now we need to create the needed directories for the setup. This will also create a /var/www directory and creates a symlink /var/www/syscp to your real installation directory. I prefer this technique to minimize the code changes needed for the Debian to SuSE migration.

mkdir /srv/www/htdocs/syscp
mkdir /var/www
ln -s /srv/www/htdocs/syscp /var/www/syscp

Now we download the current syscp tgz archive into our root's homedirectory.

cd /root
wget http:''www.syscp.de/files/downloads/syscp-1.2.10.tar.gz

After this has been done, change to your targeted syscp installation directory. I will install syscp into /srv/www/htdocs/syscp, but you may change it as you wish.

tar xzvf /root/syscp-1.2.10.tar.gz -C /srv/www/htdocs/
chown -R wwwrun:www /srv/www/htdocs/syscp/*

Now I was forced to change some settings in my SuSEfirewall? to get the system up and running. It may be the case, you don't have to change them, because they are already changed. But to be sure, take a look at yourself in your firewall settings. You have to enable at this point the following two services.

  • HTTP
  • SSH

After they are enabled, we start the apache webserver and the mysql database, just to finish the webfrontend installation of syscp.

/etc/init.d/apache2 restart
/etc/init.d/mysql restart

We need to call http:<your ip>/syscp/ to get to the installer of SysCP. The installer will ask you some questions, one thing is good to known about the installer:

  • Should you have a MySQL root password set already, you need to give it to the installer, or
  • shouldn't you have a MySQL root password, just type in your desired root password, SysCP will set it for you.

After installing SysCP just log in with your admin account and click on Settings in the Server area. Here we need to change some things:

Apache configuration directory: /etc/apache2
Where are the apache configfiles?
Apache reload command: /etc/init.d/apache2 restart
What's the apache reload command?
Bind config directory: /etc/named.d
Where are the bind config files?
Bind reload command: /etc/init.d/named reload
What's the bind reload command?

That was the easy task, now lets get into some more complicated areas, the system configuration aka. backend configuration.

4. Backend Configuration

4.1. Daemon Installation

As SuSE doesn't have support for the things we need to have to use SysCP, we are forced, to install some alien packages and to compile some other packages.

4.1.a. Postfix

The Postfix package in SuSE 9.3 hasn't been compiled with MySQL support, so we have to use packages, which are already compiled with MySQL support from http:www.norrbring.biz/SuSE/ .

cd /root
wget ftp:''ftp.norrbring.com/pub/linux/suse_apps/9.3/postfix-2.2.1-3.1.MySQL.i586.rpm
rpm -U /root/postfix-2.2.1-3.1.MySQL.i586.rpm

4.1.b. PAM MySQL

As SuSE doesn't have a pam mysql package, we need to compile our own, directly from the developers site at http:sourceforge.net/projects/pam-mysql/ .

cd /root
wget http:''mesh.dl.sourceforge.net/sourceforge/pam-mysql/pam_mysql-0.6.0.tar.gz
tar xzfv /root/pam_mysql-0.6.0.tar.gz -C /root/
cd /root/pam_mysql-0.6.0/
./configure 
make 
make install

4.1.c. Courier

SuSE doesn't even have a MySQL enabled courier package. We have to build our own one here. Since I don't want to install less as possible packages without using RPM, we use the SourceRPM package you should have installed.

  • use this file: /usr/src/packages/SPECS/courier-imap.spec
  • or use
    cat /usr/src/packages/SPECS/courier-imap.spec \
    | sed 's/^%{_prefix}\/lib\/courier-imap\/authlib\/authdaemond$/\
    %{_prefix}\/lib\/courier-imap\/authlib\/authdaemond \
    ### eremit \
    \/etc\/courier\/authmysqlrc.dist \
    %{_prefix}\/lib\/courier-imap\/authlib\/authdaemond.mysql\
    ###\n/' \
      > /usr/src/packages/SPECS/courier-imap.spec
    
rpmbuild -bb /usr/src/packages/SPECS/courier-imap.spec
rpm --install /usr/src/packages/RPMS/i586/courier-imap-3.0.8-3.i586.rpm

4.1.d. ProFTPd

There is no ProFTPd package in SuSE, not even a SourceRPM, we have to get the current stable SourceRPM package from http:www.proftpd.org and compile our own ProFTPd server.

cd /root
wget ftp:''ftp.proftpd.org/distrib/packages/SRPMS/proftpd-1.2.10-1.src.rpm
rpm --install proftpd-1.2.10-1.src.rpm
rpmbuild --with mod_sql_mysql --with mod_sql -bb /usr/src/packages/SPECS/proftpd.spec
rpm --install /usr/src/packages/RPMS/i586/proftpd-1.2.10-1.i586.rpm

The rpm --install may throw errors which you can ignore, it may be something like:

warning: user dr does not exist - using root

warning: group dr does not exist - using root
warning: user dr does not exist - using root
warning: group dr does not exist - using root

and

proftpd: unknown service
proftpd: not a runlevel service

4.2. Daemon Configuration

I will use 192.168.1.130 for my serverip, you should change it accordingly to your server ip. Be very careful using the cat | sed combination. In them I set the data according to my system. You should think twice and change them to fit your system requirements. As an alternative to the sed | cat combinations you can also use the given link to the config file and copy'n'paste it. This may be much easier for some people. I used:

Parameter Value
<SQL_UNPRIVILEGED_USER> syscp
<SQL_UNPRIVILEGED_PASSWORD> yourpass
<SQL_HOST> localhost
<SQL_DB> syscp
<VIRTUAL_UID_MAPS> 2000
<VIRTUAL_GID_MAPS> 2000
<VIRTUAL_MAILBOX_BASE> /var/kunden/mail
<SERVERNAME> myServer

4.2.a. Bind9

First of all we need to create the default.zone file, create an empty syscp_bind.conf and add the syscp_bind.conf to the named.conf .

  • use this file: /etc/named.d/default.zone
  • or use
    sed 's/<SERVERIP>/192.168.1.130/' \
      /var/www/syscp/templates/misc/configfiles/debian_sarge/bind/etc_bind_default.zone \
      > /etc/named.d/default.zone
    

Now lets create the syscp_bind.conf and lets make the include entry to the named.conf:

touch /etc/named.d/syscp_bind.conf
echo 'include "/etc/named.d/syscp_bind.conf";' >> /etc/named.conf

Now lets start bind9.

/etc/init.d/named restart

4.2.b. Apache

Some Apache configurations needs to be done too, pretty simple, create an empty vhosts.conf and include it in the httpd.conf of apache.

touch /etc/apache2/vhosts.conf
echo "Include /etc/apache2/vhosts.conf" >> /etc/apache2/httpd.conf
mkdir -p /var/kunden/webs/
mkdir -p /var/kunden/logs/

this is a good chance, also to watch the following directory-container in httpd.conf wich is default-setting

#forbid access to the entire filesystem by default
<Directory />
  Options None
  AllowOverride None
  Order deny,allow
  Deny from all
</Directory> 

You must adjust the above shown code according to your needs by either changing it or override it with your own additional directory - container. Should you leave this code untouched, remember that you have no access to the entire file-system from outside the server.

4.2.c. Postfix

First of all we need to create a virtual mail user and some directories to get postfix working.

groupadd -g 2000 vmail
useradd -u 2000 -g vmail vmail
mkdir -p /var/kunden/mail/
chown -R vmail:vmail /var/kunden/mail/
mkdir -p /etc/postfix/sasl
groupadd postdrop

Now lets create the needed configurations. ATTENTION! Within this parts you have to set your own system values, i tried to use the default settings whenever possible.

  • use this file: /etc/pam.d/smtp
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_woody/postfix/var_spool_postfix_etc_pam.d_smtp \
      | sed 's/<SQL_UNPRIVILEGED_USER>/syscp/' \
      | sed 's/<SQL_UNPRIVILEGED_PASSWORD>/yourpass/' \
      | sed 's/<SQL_HOST>/localhost/' \
      | sed 's/<SQL_DB>/syscp/' \
      > /etc/pam.d/smtp
    
  • use this file: /etc/postfix/main.cf
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/postfix/etc_postfix_main.cf \
      | sed 's/<VIRTUAL_UID_MAPS>/2000/' \
      | sed 's/<VIRTUAL_GID_MAPS>/2000/' \
    
    
      | sed 's/<VIRTUAL_MAILBOX_BASE>/\/var\/kunden\/mail/' \
      | sed 's/<SERVERNAME>/myServer/' \
      > /etc/postfix/main.cf
    echo daemon_directory = /usr/lib/postfix >> /etc/postfix/main.cf
    
  • use this file: /etc/postfix/mysql-virtual_alias_maps.cf
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/postfix/etc_postfix_mysql-virtual_alias_maps.cf \
      | sed 's/<SQL_UNPRIVILEGED_USER>/syscp/' \
      | sed 's/<SQL_INPRIVILEGED_PASSWORD>/yourpass/' \
      | sed 's/<SQL_DB>/syscp/' \
      | sed 's/<SQL_HOST>/localhost/' \
      > /etc/postfix/mysql-virtual_alias_maps.cf
    
  • use this file: /etc/postfix/mysql-virtual_mailbox_maps.cf
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/postfix/etc_postfix_mysql-virtual_mailbox_maps.cf \
      | sed 's/<SQL_UNPRIVILEGED_USER>/syscp/' \
      | sed 's/<SQL_UNPRIVILEGED_PASSWORD>/yourpass/' \
      | sed 's/<SQL_DB>/syscp/' \
      | sed 's/<SQL_HOST>/localhost/' \
      > /etc/postfix/mysql-virtual_mailbox_maps.cf
    
  • use this file: /etc/postfix/mysql-virtual_mailbox_domains.cf
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/postfix/etc_postfix_mysql-virtual_mailbox_domains.cf \
      | sed 's/<SQL_UNPRIVILEGED_USER>/syscp/' \
      | sed 's/<SQL_UNPRIVILEGED_PASSWORD>/yourpass/' \
      | sed 's/<SQL_DB>/syscp/' \
      | sed 's/<SQL_HOST>/localhost/' \
      > /etc/postfix/mysql-virtual_mailbox_domains.cf
    
  • use this file: /etc/postfix/sasl/smtpd.conf
  • or use
    cp /var/www/syscp/templates/misc/configfiles/debian_woody/postfix/etc_postfix_sasl_smtpd.conf \
      /etc/postfix/sasl/smtpd.conf
    
  • use this file: /etc/sysconfig/saslauthd
  • or use
    cat /etc/sysconfig/saslauthd \
      | sed 's/======pam$/======="pam -r"/' \
      > /etc/sysconfig/saslauthd
    

Now lets start postfix

/etc/init.d/postfix restart
/etc/init.d/saslauthd restart

4.2.d. Courier Authdaemon & POP

FIXME Describe IMAP installation!

Now we have to configure our always beloved POP3 server.

ATTENTION! Within this parts you have to set your own system values, i tried to use the default settings whenever possible.

  • use this file: /etc/courier/authdaemonrc
  • or use
    cat /etc/courier/authdaemonrc \
      | sed 's/^authmodulelist======.*/authmodulelist======="authmysql"/' \
      | sed 's/^version======.*/version======="authdaemond.mysql"/' \
      > /etc/courier/authdaemonrc
    
    
  • use this file: /etc/courier/authmysqlrc
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/courier/etc_courier_authmysqlrc \
      | sed 's/<SQL_HOST>/localhost/' \
      | sed 's/<SQL_UNPRIVILEGED_USER>/syscp/' \
      | sed 's/<SQL_UNPRIVILEGED_PASSWORD>/yourpass/' \
      | sed 's/<SQL_DB>/syscp/' \
      > /etc/courier/authmysqlrc
    
    

And let's restart everything we just configured.

/etc/init.d/courier-authdaemon restart
/etc/init.d/courier-pop3 restart

4.2.e. ProFTPd

ProFTPd is some work to get it configured. First of all we need to install a working SuSE compliant init.d script. You can do it, by simply copy'n'past the following code area with your favorite editor into /etc/init.d/proftpd . You should take care not to use windows linebreaks, and not to break lines where it is not in the script!

Now we can start with the ProFTPd configuration. And as above, you have to replace some of the values with values which fit your system envoirement!

  • use this file: /etc/proftpd.conf
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/proftpd/etc_proftpd.conf \
      | sed 's/<SQL_HOST>/localhost/' \
      | sed 's/<SQL_DB>/syscp/' \
      | sed 's/<SQL_UNPRIVILEGED_USER>/syscp/' \
      | sed 's/<SQL_UNPRIVILEGED_PASSWORD>/yourpass/' \
      | sed 's/<SERVERNAME>/YourServer/' \
      > /etc/proftpd.conf
    
chmod 755 /etc/init.d/proftpd

ln -s /etc/init.d/proftpd /usr/sbin/rcproftpd

Configuration finished, lets restart proftpd.

/etc/init.d/proftpd restart

4.2.f. Cronscript

And as the last part of our work, we have to install the syscp cronscript. This part is one of the most important parts, since nearly nothing works without the cronscript.

  • use this file: /etc/cron.d/syscp
  • or use
    cat /var/www/syscp/templates/misc/configfiles/debian_sarge/cron/etc_cron.d_syscp \
      | sed 's/php4/php/' \
      > /etc/cron.d/syscp
    
mkdir -p /etc/php4/syscpcron

cp /var/www/syscp/templates/misc/configfiles/debian_sarge/cron/etc_php4_syscpcron_php.ini \
   /etc/php4/syscpcron/php.ini

chmod 644 /etc/cron.d/syscp

Let's restart the cron daemon, and we are really finished.

/etc/init.d/cron restart

5. Author's Notes

You are now finished with your syscp installation. Some things you should keep in mind. Since we have installed an alien package and compiled some packages our own, you must be really carefull what you update. If you update a self-compiled package with a standard update procedure, the package will break. You also have to keep an eye on the alien packages you installed, maybe there are security bugs coming up, you should be aware of. If this happens you'll have to recompile the alien package ( PAM_MySQL ) or reinstall the package ( Postfix ). Since SysCP was not designed to have SuSE as it's main distribution, you should have some deep knowledge about the SuSE internals.

5.1. Credits

Some thank you's goes to:

  • Ron Brand for testing this HowTo and his translation to german.
  • miles for some basic things, what I've to think about during the installation
  • Anders Norrbring for his postfix packages provided at http:www.norrbring.biz/SuSE/

6. Disclaimer

This document is offered to the best of our knowledge. The procedures described therein have been tested multiple times before publishing it, however, usage is at your own risc. The author(s) is/are not responsible for any kind of software and/or hardware damage, which may occur.

7. Todo

  • IMAP Server installation

8. History

[2005-07-14]: First release after 4 days of hard work