================================
ISPManCCP - Install Instructions
================================

The one thing ISPManCCP can't do for you is install
`python-ldap <http://python-ldap.sourceforge.net/>`_ and
`pyDNS <http://pydns.sourceforge.net/>`_, but most
distributions can provide that for you.

**NOTE**: If you choose not to install `pyDNS
<http://pydns.sourceforge.net/>`_, the only that will happen is that email
forwarding addresses will not be checked for a valid DNS MX record.
`python-ldap <http://python-ldap.sourceforge.net/>`_ on the other hand is
**required** and will make setup fail if not present on your system.

After `python-ldap <http://python-ldap.sourceforge.net/>`_ and
`pyDNS <http://pydns.sourceforge.net/>`_ is installed, ISPManCCP
can then be installed with `Easy Install
<http://peak.telecommunity.com/DevCenter/EasyInstall>`_ by typing::

    > easy_install ISPManCCP

If the above fails and you're on debian, please do::

    > apt-get install libperl-dev

Then try to install ISPManCCP again.

Now make a config file as follows::

    > mkdir /etc/ispmanccp
    > cd /etc/ispmanccp
    > paster make-config ISPManCCP config.ini

I created a directory in ``/etc`` because ISPManCCP creates a ``data``
sub-directory where the ``config.ini`` resides if you don't change
``cache_data_dir`` and ``session_data_dir`` to point to an absolute path,
ie, without that ``%(here)s``.


You should now edit ``config.ini`` and change it to your needs.


Serve the application
---------------------

You can serve the application with `paster <http://pythonpaste.org/>`_ by typing::

    > paster serve /etc/ispmanccp/config.ini

Since most `ISPMan <http://ispman.net>`_ installations will already have
apache  installed, you can opt by having apache proxy requests to/from `paster
<http://pythonpaste.org/>`_. I find this the ideal setup because I can just run
`paster <http://pythonpaste.org/>`_ with a specific user and group(one with
permissions to read from the `ISPMan <http://ispman.net>`_ installation and
still use port 80.

Of course, running paster like shown on the above command means you have to do
it by hand. `Paster <http://pythonpaste.org/>`_ can be daemon'ized, so you
could create an init script.

Bellow I'll show you some examples on how you could use `paster
<http://pythonpaste.org/>`_ running as a daemon with user *ccp*, group
*ispman* and logging to */etc/ispman/ispmanccp.log*

Starting `paster <http://pythonpaste.org/>`_::

    > /usr/bin/paster serve --daemon --user=ccp --group=ispman \
      --log-file=/etc/ispmanccp/ispmanccp.log /etc/ispmanccp/config.ini start


Stopping `paster <http://pythonpaste.org/>`_::

    > /usr/bin/paster serve --daemon --user=ccp --group=ispman \
      --log-file=/etc/ispmanccp/ispmanccp.log /etc/ispmanccp/config.ini stop


Re-starting `paster <http://pythonpaste.org/>`_::

    > /usr/bin/paster serve --daemon --user=ccp --group=ispman \
      --log-file=/etc/ispmanccp/ispmanccp.log /etc/ispmanccp/config.ini restart


Now, here's a minimal apache *vhost* configuration example::

    <VirtualHost *:80>
        ServerName ccp.domain.tld
        ProxyPreserveHost On
        <Location />
            SetHandler None
            ProxyPass http://localhost:5000
            ProxyPassReverse http://localhost:5000
            AllowOverride None
            Order allow,deny
            Allow from all
        </Location>
    </VirtualHost>



And that's about it.

You can find more info on the
`ISPManCCP <http://ccp.ufsoft.org/>`_ site where bugs and new feature requests
should go to.
