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

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

================================================================================
1) Version Info
---------------
ispCP ω Version: 1.0.7
INSTALL Script:		1.7
Maintainer: 		ispcp@pasichnyk.net
Homepage:			http://isp-contol.net
Linux Distros:		Gentoo

================================================================================
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 Gentoo required packages are listed in ./docs/Gentoo/gentoo-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. Add to your /etc/make.conf following lines:
	# cat >>/etc/make.conf <<eof
	# APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm
	# authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner
	# authz_user autoindex dav dav_fs dav_lock dbd deflate dir env expires ext_filter filter
	# headers ident imagemap include info log_config logio mime mime_magic negotiation proxy
	# proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status
	# unique_id userdir usertrack vhost_alias"
	# APACHE2_MPMS="worker"
	# eof

 2. Customize your use flags. There are a few packages which need some use flags removed. Put
    the following in /etc/portage/package.use

	# cat >>/etc/portage/package.use<<eof
	# net-libs/courier-authlib -mysql -pam
	# mail-mta/postfix -mysql -pam
	# eof

 3. Unmask a few packages. A few packages that the default ispCP setup requires are masked.
    Add the following to the /etc/portage/package.keywords

	# cat >>/etc/portage/package.keywords<<eof
	=mail-filter/policyd-1.82
	=mail-filter/policyd-weight-0.1.14.17
	dev-perl/Net-LibIDN
	# eof

 4. Install Postfix, and remove ssmtp

	# emerge --unmerge ssmtp && emerge -uDNva postfix

 5. Install the required modules:

	# emerge -ua `cat ./docs/Gentoo/gentoo-packages`

 6. Modify Apache's configuration. Edit /etc/conf.d/apache2 you need to add these to the APACHE2_OPTS line

	  -D PROXY -D CBAND -D FCGID

	Remove:

	  -D PHP5

	edit /etc/apache2/modules.d/10_mod_cband.conf and add allow from etc.. so no one can reset your
	clients stats

	  <Location /cband-status>
        SetHandler cband-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
	  </Location>

 7. Setup MySQL

	# /usr/bin/mysql_install_db
	# /etc/init.d/mysql restart
	# /usr/bin/mysql_secure_installation
	# /etc/init.d/mysql restart

================================================================================
4) Installation
---------------
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. (optional) Check the ispcp.conf and adapt it to your requirements.

4. Return to the parent direction and build the System by using make:
	# make -f Makefile.gentoo install

5. Copy all the directories into the system (you may make backups)
	# cp -RvL /tmp/ispcp/* /

6. Now it's time to set up the frontend. Change into the engine directory:
	# cd /var/www/ispcp/engine/setup

6a.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

7. Start the engine setup:
	# ./ispcp-setup

8. Install 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.

9. Start required services, and set them to start on boot:

	# rc-update add vixie-cron default
	# rc-update add syslog-ng default
	# rc-update add apache2 default
	# rc-update add mysql default
	# rc-update add named default
	# rc-update add postfix default
	# rc-update add proftpd default
	# rc-update add courier-authlib default
	# rc-update add courier-imapd default
	# rc-update add courier-pop3d default
	# rc-update add courier-imapd-ssl default
	# rc-update add courier-pop3d-ssl default
	# rc-update add amavisd default
	# rc-update add clamd default
	# rc-update add policyd default
	# rc-update add policyd-weight default
	# rc-update add saslauthd default
	# rc-update add spamd default
	# rc-update add postgrey default
	# rc-update add ispcp_daemon default
	# rc-update add ispcp_network default

	# /etc/init.d/vixie-cron restart
	# /etc/init.d/syslog-ng restart
	# /etc/init.d/apache2 restart
	# /etc/init.d/mysql restart
	# /etc/init.d/named restart
	# /etc/init.d/postfix restart
	# /etc/init.d/proftpd restart
	# /etc/init.d/courier-authlib restart
	# /etc/init.d/courier-imapd restart
	# /etc/init.d/courier-pop3d restart
	# /etc/init.d/courier-imapd-ssl restart
	# /etc/init.d/courier-pop3d-ssl restart
	# /etc/init.d/amavisd restart
	# /etc/init.d/clamd restart
	# /etc/init.d/policyd restart
	# /etc/init.d/policyd-weight restart
	# /etc/init.d/saslauthd restart
	# /etc/init.d/spamd restart
	# /etc/init.d/postgrey restart
	# /etc/init.d/ispcp_daemon restart
	# /etc/init.d/ispcp_network restart

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

11. Open /etc/conf.d/postgrey and update POSTGREY_PORT="10023"

================================================================================
5) 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:
	# emerge -ua `cat ./docs/Gentoo/gentoo-packages`

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

5. Stop the ispcp_deamon and build the System by using make:
	# /etc/init.d/ispcp_daemon stop
	# make -f Makefile.gentoo install

6. 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 -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/

7. 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}

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

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

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

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

12. 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.

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

================================================================================
6) 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

================================================================================
7) 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!
