ispCP ω (OMEGA) HowTo Install for CentOS 5.4
================================================================================
For other Linux distributions please check the other INSTALL files.
================================================================================

Table of Content
================
1) Version Info
2) Requirements
3) Introduction
4) Preparation
5) Installation
6) Post-Installation
7) Update
8) Uninstall
9) Credits

================================================================================
1) Version Info
---------------

ispCP Version:         1.0.7
INSTALL Script:        1.8
Maintainer:            motokochan
Homepage:              http://isp-contol.net
Linux Distros:         CentOS 5.4

This documentation was written for CentOS 5, specifically 5.4. While you might
be able to install on earlier versions, you may encounter difficulties or
differences. In addition, this guide uses the YUM tool to install packages. If
you normally use a different tool, you will need to modify the instructions to
fit your system.
The instructions are based on a minimum installation of CentOS with no optional
packages marked during OS install. If you selected additional options during the
install process, some extra server services may need to be disabled to avoid
interfering with the packages used by ispCP ω.
The install instructions attempt to keep system changes to a minimum, so these
instructions should also work under Red Hat Enterprise Linux 5. If you encounter
differences, please notify the maintainer.
The install instructions should be done under the root account

================================================================================
2) Requirements
---------------
There is no must have for a system using ispCP ω This is only a recommendation:

Pentium III or K6-4 with 500 MHz
512 MB RAM
100 MB disk space (only for install of ispCP ω
Debian (or even any other *NIX-Distribution)

All required packages are listed in /docs/CentOS/centos-packages

================================================================================
3) Introduction
---------------
ispCP ω delivers a complete hosting automation appliance by offering significant
security, total-cost-of-ownership, and performance advantages over competing
commercial solutions.

With ispCP ω you can configure your server and applications, create user with
domains with a few point-and-click operations that take less than a minute.
There is no limit to the number of resellers, users and domains that can be
created. The core of ispCP ω are 3 easy-to-use, web-based control panels. ispCP
provides graphic user interfaces for the administrators, resellers and users.

================================================================================
4) Preparation
--------------
For the following steps, you will need to be logged in as root.

1. Make sure your OS is updated
   The very first thing you should do is make sure your base Linux install is
   fully updated. To do so, simply run "yum update" as root. If there was a
   kernel upgrade, you will want to reboot before continuing.
        # yum update

2. Additional Software Repositories
   The CentOS repositories do not include all the software needed to run icpCP ω.
   You will need to add two repositories to your system to install everything
   you need.

   EPEL (Extra Packages for Enterprise Linux):
        EPEL contains most of the additional packages needed.
        Install this repository following
        http://fedoraproject.org/wiki/EPEL/FAQ#howtouse

   Les RPM de Remi:
        Remi Collet maintains a repository of updated packages for Fedora and
        CentOS/RHEL. We need his repository to install updated PHP and MySQL
        packages as CentOS 5 comes with PHP 5.1 and we need PHP 5.2 at a minimum.
        Install the repository following
        http://blog.famillecollet.com/pages/Config-en

        The repository installs in a disabled state. We now want to enable the
        repository and only include the packages we want from it. To do this,
        edit the file /etc/yum.repos.d/remi.repo. In the file, under the [remi]
        heading, change the value of enabled from 0 to 1, then add the following
        line at the bottom of that section:

 	    includepkgs=mysql* php* sqlite*

 	RPMForge:
 	    RPMForge is needed for one package that none of the other repositories
 	    currently has.
 	    Install the repository following http://dag.wieers.com/rpm/FAQ.php#B2
 	    We do not want all the packages from RPMForge as it replaces a good deal
 	    of the system. To avoid this, edit the file /etc/yum.repos.d/rpmforge.repo.
 	    In the file, add the following line at the end:

 	    includepkgs=postgrey

3. Non-Repository Software
   There are a few pieces of software you will need to download individually
   that are in any of the major repositories.

   Courier-IMAP:
        Michael Fleming maintains RPMs of Courier-IMAP on his website,
        http://www.thatfleminggent.com
        You will need to download the latest RPMs of courier-imap,
        courier-authlib, and courier-authlib-userdb from his site at the
        following locations:

        i386 (32-bit):
        http://www.thatfleminggent.com/packages/centos/5/i386/repoview/system_environment.daemons.group.html
        x86_64 (64-bit):
        http://www.thatfleminggent.com/packages/centos/5/x86_64/repoview/system_environment.daemons.group.html

   policyd-weight:
        RPMs for policyd-weight can be found at
        http://sourceforge.net/projects/policyd-weight/files/

4. Disabling SELinux
   SELinux will need to be disabled if it is enabled. To disable, run

    # setenforce 0

   as root. To ensure that it stays disabled between reboots, edit the file
   /etc/selinux/config and change the value of SELINUX to disabled.

5. Remove not needed packages
   CentOS installs Sendmail by default, but icpCP ω uses Postfix. Run
    # yum remove sendmail
   to remove Sendmail and have CentOS switch to the Postfix.

6. Configuring Services
    Courier needs a user and group account configured to run, and the following
    commands run as root will create them:
     # groupadd -g 3000 courier
     # useradd -u 3000 -c 'Courier Mail Server' -d /dev/null -g courier -d /bin/false courier

================================================================================
5) Installation
---------------
Make sure you are logged in as root and MySQL is running (Start with "service mysqld start").

1. Untar or unzip the distribution files to a secure directory:
	# cd /usr/local/src
	# tar xjvf ispcp-omega-1.0.7.tar.bz2

2. Change to the newly created directory:
	# cd ./ispcp-omega-1.0.7

3. Install the required modules
   A list of packages required by this software is located in
   /docs/CentOS/centos-packages and can be used to easily install the packages
   you need by running the following command:
    # yum install `cat ./docs/CentOS/centos-packages`

   NOTE: Running this command will install both x86_64 and i3/5/686 packages on
   x86_64 installs for all packages that have both architectures in the
   repository! To avoid, either add "exclude=*.i386 *.i586 *.i686" for your yum
   repository configuration files, or install the packages listed in the file
   one-by-one, making sure to specify the package name in the format
   packagename.x86_64.

4. Install required Perl package
    # perl -MCPAN -e 'install Term::ReadPassword'

   If you have not run CPAN before, you will be prompted for manual
   configuration. You can simply say no and the install will continue.

5. Install downloaded RPMs
    # rpm -Uvh courier-*
    # rpm -Uvh policyd-weight-*

6. Clean Apache's conf.d directory
    # mv /etc/httpd/conf.d /etc/httpd/conf.d-disabled

7. Configure BIND DNS
    # mv /var/named/data /var/named/data-disabled
    # ln -s /var/named/chroot/var/named/data /var/named/data
    # echo 'include "/etc/named-ispcp.conf";' >> /var/named/chroot/etc/named.conf

8. (optional) Check the ispcp.conf and adapt it to your requirements.

9. Build the Software by using make:
	# make -f Makefile.centos

10. Copy all the directories into your system. If you have not yet, now is a good
   time to make backups of your server. The following steps do fundamental
   changes to your system configuration.
	# cp -RLf /tmp/ispcp/* /

7. Change or create MySQL root password, remove anonymous users, disallow root
	login remotely, remove test database (and access to it), reload privilege tables.
	# mysql_secure_installation

8. Now it's time to set up the frontend. Change into the engine directory and
	start the engine setup:
	# cd /var/www/ispcp/engine/setup
	# perl ispcp-setup

9. Install ispCP ω step-by-step

    NOTE: During setup, you will be asked if you are using fastcgi or fcgid.
    You will want to choose the option for fcgid (shortcut key "f" on the prompt).

    If you get no error, all went good; if you get one, look at
    http://isp-control.net to solve the problem.

10. Clean the temporary folders:
	# rm -fR /tmp/ispcp/

================================================================================
6) Post-Installation
--------------------

1. Configuring Services

    Postfix and SASL Authentication:
        We need to create the SASL database for authenticating mail users and
        configure SASL authenitcation. First, we create the SASL database with
        the following commands:
        # touch /etc/sasldb2
        # mkdir -p /var/spool/postfix/etc
        # cp /etc/sasldb2 /var/spool/postfix/etc

        To allow authentication, edit /usr/lib/sasl2/smtpd.conf
        (/usr/lib64/sasl2/smtpd.conf for x86_64) and replace the contents with
        the following:

        pwcheck_method: auxprop
        auxprop_plugin: sasldb
        mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5

    Configure Apache HTTPd:
        The Apache webserver needs to be configured to read website configuration
        in the directory /etc/httpd/vhosts/. To establish this, run the following
        command:

        # echo 'include vhosts/*.conf' >> /etc/httpd/conf/httpd.conf

    Configure Postgrey:
        By default, Postgrey runs on a socket. We want it to run on port 10023.
        Edit the file /etc/init.d/postgrey and change the line:

        OPTIONS="--unix=$SOCKET"

        to

        OPTIONS="--unix=$SOCKET --inet=10023"

2. Setting Services to Run on Boot
    Several services need to be set to run on boot. To do this, run the
    following commands:

    # chkconfig --level 345 httpd on
    # chkconfig --level 345 mysqld on
    # chkconfig --level 345 ispcp_network on
    # chkconfig --level 345 ispcp_daemon on
    # chkconfig --level 345 amavisd on
    # chkconfig --level 345 named on
    # chkconfig --level 345 proftpd on
    # chkconfig --level 345 postgrey on
    # chkconfig --level 345 spamassassin on

    If you want to start the services without a reboot, run the following
    commands:

    # service httpd start
    # service mysqld start
    # service ispcp_network start
    # service ispcp_daemon start
    # service amavisd start
    # service named start
    # service proftpd start
    # service postgrey start
    # service spamassassin start

3. Set Permissions
    The default permissions for the temporary directory of the control panel
    need to be adjusted. Please run the following command:

    # chmod 775 /var/www/ispcp/gui/phptmp

================================================================================
7) Update
---------
NOTE: ispCP ω can only be updated from post 1.0.0. If you have a
version prior 1.0.0 (final release) installed, update to ispCP ω 1.0.0 first.

Make sure you are logged in as root and MySQL is running.

1. Untar or unzip the distribution files to a secure directory:
	# cd /usr/local/src
	# tar xjvf ispcp-omega-1.0.7.tar.bz2

2. Change to the newly created directory:
	# cd ./ispcp-omega-1.0.7

3. Install the required modules
   first update your system:
	# yum update
	# yum install `cat ./docs/CentOS/centos-packages`

4. Stop the ispcp_deamon and build the Software by using make:
	# services ispcp_daemon stop
	# make -f Makefile.centos

5. Backup files
	# cp -v /var/www/ispcp/engine/ispcp-db-keys.pl /tmp/ispcp/var/www/ispcp/engine/
	# cp -v /var/www/ispcp/engine/messenger/ispcp-db-keys.pl /tmp/ispcp/var/www/ispcp/engine/messenger/
	# cp -v /var/www/ispcp/gui/include/ispcp-db-keys.php /tmp/ispcp/var/www/ispcp/gui/include/
	# cp -v /var/www/ispcp/gui/themes/user_logos/* /tmp/ispcp/var/www/ispcp/gui/themes/user_logos/
	# cp -TRv /var/www/ispcp/gui/domain_default_page /tmp/ispcp/var/www/ispcp/gui/domain_default_page
	# cp -v /var/www/ispcp/gui/tools/webmail/data/* /tmp/ispcp/var/www/ispcp/gui/tools/webmail/data/

	For ispCP Omega prior version 1.0.7 RC2
	# cp -v /var/www/ispcp/gui/tools/pma/config.inc.php /tmp/ispcp/etc/ispcp/pma/working/


6. Delete old files to avoid security risks:
	# rm -Rf /var/www/ispcp/engine/
	# rm -Rf /var/www/ispcp/gui/{admin,client,include,orderpanel,themes,reseller}/
	# rm -Rf /var/www/ispcp/gui/tools/{pma/,filemanager/,webmail/,index.php}
	# rm -Rf /var/www/ispcp/gui/{*.php,favicon.ico,robots.txt}

7. Copy /usr and /var directories into your system (you may make backups)
	# cp -RLf /tmp/ispcp/usr/* /usr/
	# cp -RLf /tmp/ispcp/var/* /var/

8. Backup ispcp.conf and copy the /etc directory into your system (you may make backups):
	# mv /etc/ispcp/ispcp.conf /etc/ispcp/ispcp.old.conf
	# cp -RLf /tmp/ispcp/etc/* /etc/

9. Now it's time to update your installation. Change into the engine directory:
	# cd /var/www/ispcp/engine/setup

10. Start the engine update:
	# perl ispcp-update

11. Update ispCP ω step-by-step

	If you get no error, all went good; if you get one, look at
	http://isp-control.net to solve the problem.

12. Clean the temporary folders:
	# rm -fR /tmp/ispcp/

================================================================================
8) Uninstall
------------
Make sure you are logged in as root and MySQL is running.

1. Change into the engine directory:
	# cd /var/www/ispcp/engine/setup

2. Start the uninstall script:
	# perl ispcp-uninstall

3. Clean up your system

================================================================================
9) Credits
----------

ispCP ω is a project of ispCP | isp Control Panel.
ispCP, ispCP ω, isp Control Panel, the ispCP logo and the ω Logo are trademarks
of the ispCP | isp Control Panel Project Team.

Please visit our site under http://isp-control.net for further information on
ispCP ω, ispCP and other themes.

We hope you enjoy using ispCP ω. If you like it, help us, to make it better. We
would be glad on any help provided!
