Table of Contents

Tested on ispCP 1.0.5; running Ubuntu 9.10

This guide will allow you to access the different tools provided with ispCP (PhpMyAdmin, Filemanager, Webmail, etc..) to be acessible using the following addresses :

The standard addresses used by ispCP, such as http://your_company.org/pma (for PhpMyAdmin) or disabled by default in this tutorial.

Updating DNS files

vim /etc/ispcp/bind/parts/db_e.tpl

Find :

; CNAME for web transfer
ftp             IN              CNAME           www

Add after :

*               IN              A               {DMN_IP}

Save & close.

Updating Apache files

Open up the file for domain aliases :

vim /etc/ispcp/apache/parts/als_entry.tpl

Replace :

ServerAlias     www.{ALS_NAME} {ALS_NAME} *.{ALS_NAME}

By :

ServerAlias     www.{ALS_NAME} ftp.{ALS_NAME}

Replace :

    RedirectMatch permanent ^/ftp([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/ftp/
    RedirectMatch permanent ^/pma([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/pma/
    RedirectMatch permanent ^/webmail([\/]?)   {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/webmail/
    RedirectMatch permanent ^/ispcp([\/]?)             {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/

By :

    #RedirectMatch permanent ^/ftp([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/ftp/
    #RedirectMatch permanent ^/pma([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/pma/
    #RedirectMatch permanent ^/webmail([\/]?)   {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/webmail/
    #RedirectMatch permanent ^/ispcp([\/]?)             {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/

Save & close.

Open up the file for domains :

vim /etc/ispcp/apache/parts/dmn_entry.tpl

Replace :

ServerAlias     www.{DMN_NAME} {DMN_NAME} *.{DMN_NAME} {SUEXEC_USER}.{BASE_SERVER_VHOST}

By :

 ServerAlias     www.{DMN_NAME} ftp.{DMN_NAME} {SUEXEC_USER}.{BASE_SERVER_VHOST}

Replace :

    RedirectMatch permanent ^/ftp([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/ftp/
    RedirectMatch permanent ^/pma([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/pma/
    RedirectMatch permanent ^/webmail([\/]?)   {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/webmail/
    RedirectMatch permanent ^/ispcp([\/]?)             {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/

By :

    #RedirectMatch permanent ^/ftp([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/ftp/
    #RedirectMatch permanent ^/pma([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/pma/
    #RedirectMatch permanent ^/webmail([\/]?)   {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/webmail/
    #RedirectMatch permanent ^/ispcp([\/]?)             {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/

Save & close.

Open up the file for sub-domains :

vim /etc/ispcp/apache/parts/sub_entry.tpl

Replace :

ServerAlias     www.{SUB_NAME} {SUB_NAME} *.{SUB_NAME}

By :

ServerAlias     www.{SUB_NAME} ftp.{SUB_NAME}

Replace :

    RedirectMatch permanent ^/ftp([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/ftp/
    RedirectMatch permanent ^/pma([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/pma/
    RedirectMatch permanent ^/webmail([\/]?)   {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/webmail/
    RedirectMatch permanent ^/ispcp([\/]?)             {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/

By :

    #RedirectMatch permanent ^/ftp([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/ftp/
    #RedirectMatch permanent ^/pma([\/]?)               {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/pma/
    #RedirectMatch permanent ^/webmail([\/]?)   {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/webmail/
    #RedirectMatch permanent ^/ispcp([\/]?)             {BASE_SERVER_VHOST_PREFIX}{BASE_SERVER_VHOST}/

Creating panel.domain.tld, webmail.domain.tld, pma.domain.tld, and ftp.domain.tld apache files

ispCP Panel

The default 00_master.conf file will be used to host the address panel.domain.tld.

vim /etc/apache2/sites-available/00_master.conf

Find :

<VirtualHost {BASE_SERVER_IP}:80>

Before, add :

<VirtualHost SERVER_IP:80>
	ServerName SERVER_VHOST
	Redirect / http://panel.DOMAIN.TLD
</VirtualHost>

Replace :

DocumentRoot    /var/www/ispcp/gui

ServerName {BASE_SERVER_VHOST}

By :

DocumentRoot    /var/www/ispcp/gui

ServerName panel.DOMAIN.TLD

Replace :

    Alias /pma      /var/www/ispcp/gui/tools/pma/
    Alias /webmail  /var/www/ispcp/gui/tools/webmail/
    Alias /ftp      /var/www/ispcp/gui/tools/filemanager/

By :

    #Alias /pma      /var/www/ispcp/gui/tools/pma/
    #Alias /webmail  /var/www/ispcp/gui/tools/webmail/
    #Alias /ftp      /var/www/ispcp/gui/tools/filemanager/

Save & close.

Be careful to replace ALL of the DOMAIN.TLD addresses by FQDN you wish to use to access the panel and its different tools, as well as SERVER_IP and SERVER_VHOST with your respective server IP address and name!

Webmail

Now we create the file used to access the webmail :

vim /etc/apache2/sites-available/02_webmail.conf

Paste the following code :

<VirtualHost SERVER_IP:80>

    ServerAdmin     ADMIN_EMAIL_ADDRESS
    DocumentRoot    /var/www/ispcp/gui/tools/webmail

    ServerName      webmail.DOMAIN.TLD

    ErrorLog        /var/log/apache2/users/webmail-error.log
    TransferLog     /var/log/apache2/users/webmail-access.log
    CustomLog       /var/log/apache2/webmail-traf.log traff
    CustomLog       /var/log/apache2/webmail-combined.log combined

    <IfModule suexec_module>
           SuexecUserGroup vu2000 vu2000
    </IfModule>

    <Directory /var/www/ispcp/gui/tools/webmail>
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <IfModule mod_fcgid.c>
        <Directory /var/www/ispcp/gui/tools/webmail>
            FCGIWrapper /var/www/fcgi/master/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php5/ /var/www/fcgi/master/
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>

    <IfModule mod_php5.c>
        <Directory /var/www/ispcp/gui/tools/webmail>
            php_admin_value open_basedir "/var/www/ispcp/gui/tools/webmail/:/etc/ispcp/:/var/run/ispcp.lock:/proc/:/bin/df:/bin/mount:/var/log/rkhunter.log:/var/log/chkrootkit.log:/usr/share/php/"
            php_admin_value session.save_path "/var/www/ispcp/gui/phptmp/"
            php_admin_value upload_tmp_dir "/var/www/ispcp/gui/phptmp/"
        </Directory>
    </IfModule>

</VirtualHost>

Again, you must replace BASE_SERVER_IP by your server IP, DEFAULT_ADMIN_ADDRESS by the admin's email address, and DOMAIN.TLD by the FQDN you want to use.

PhpMyAdmin

Now we create the file used to access PhpMyAdmin :

vim /etc/apache2/sites-available/03_pma.conf

Paste the following code :

<VirtualHost SERVER_IP:80>

    ServerAdmin     ADMIN_EMAIL_ADDRESS
    DocumentRoot    /var/www/ispcp/gui/tools/pma

    ServerName      pma.DOMAIN.TLD

    ErrorLog        /var/log/apache2/users/pma-error.log
    TransferLog     /var/log/apache2/users/pma-access.log
    CustomLog       /var/log/apache2/pma-traf.log traff
    CustomLog       /var/log/apache2/pma-combined.log combined

    <IfModule suexec_module>
           SuexecUserGroup vu2000 vu2000
    </IfModule>

    <Directory /var/www/ispcp/gui/tools/pma>
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <IfModule mod_fcgid.c>
        <Directory /var/www/ispcp/gui/tools/pma>
            FCGIWrapper /var/www/fcgi/master/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php5/ /var/www/fcgi/master/
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>

    <IfModule mod_php5.c>
        <Directory /var/www/ispcp/gui/tools/pma>
            php_admin_value open_basedir "/var/www/ispcp/gui/tools/pma/:/etc/ispcp/:/var/run/ispcp.lock:/proc/:/bin/df:/bin/mount:/var/log/rkhunter.log:/var/log/chkrootkit.log:/usr/share/php/"
            php_admin_value session.save_path "/var/www/ispcp/gui/phptmp/"
            php_admin_value upload_tmp_dir "/var/www/ispcp/gui/phptmp/"
        </Directory>
    </IfModule>

</VirtualHost>

Don't forget, you must replace BASE_SERVER_IP by your server IP, DEFAULT_ADMIN_ADDRESS by the admin's email address, and DOMAIN.TLD by the FQDN you want to use.

Webftp

Finally, we create the file that will be used to access the Filemanager.

vim /etc/apache2/sites-available/04_webftp.conf

Paste the following code :

<VirtualHost SERVER_IP:80>

    ServerAdmin     ADMIN_EMAIL_ADDRESS
    DocumentRoot    /var/www/ispcp/gui/tools/filemanager

    ServerName      webftp.DOMAIN.TLD

    ErrorLog        /var/log/apache2/users/webftp-error.log
    TransferLog     /var/log/apache2/users/webftp-access.log
    CustomLog       /var/log/apache2/webftp-traf.log traff
    CustomLog       /var/log/apache2/webftp-combined.log combined

    <IfModule suexec_module>
           SuexecUserGroup vu2000 vu2000
    </IfModule>

    <Directory /var/www/ispcp/gui/tools/filemanager>
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <IfModule mod_fcgid.c>
        <Directory /var/www/ispcp/gui/tools/filemanager>
            FCGIWrapper /var/www/fcgi/master/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php5/ /var/www/fcgi/master/
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>

    <IfModule mod_php5.c>
        <Directory /var/www/ispcp/gui/tools/filemanager>
            php_admin_value open_basedir "/var/www/ispcp/gui/tools/filemanager/:/etc/ispcp/:/var/run/ispcp.lock:/proc/:/bin/df:/bin/mount:/var/log/rkhunter.log:/var/log/chkrootkit.log:/usr/share/php/"
            php_admin_value session.save_path "/var/www/ispcp/gui/phptmp/"
            php_admin_value upload_tmp_dir "/var/www/ispcp/gui/phptmp/"
        </Directory>
    </IfModule>

</VirtualHost>

As always, you must replace BASE_SERVER_IP by your server IP, DEFAULT_ADMIN_ADDRESS by the admin's email address, and DOMAIN.TLD by the FQDN you want to use.

Activating the new virtual hosts

Placing ourselves in the correct directory :

cd /etc/apache2/sites-available

Activating virtual hosts :

a2ensite 02_webmail.conf
a2ensite 03_pma.conf
a2ensite 04_webftp.conf

Reload Apache 2 :

/etc/init.d/apache2 reload

If you get no warnings/errors, you're good to go! If you do, double check your files, something is wrong!

Updating ispCP configuration

This modification will allow for all dependent files to have the correct link to the different tools used by ispCP.

vim /etc/ispcp/ispcp.conf

Replace :

BASE_SERVER_VHOST = old-address.net

By :

BASE_SERVER_VHOST = panel.DOMAIN.TLD

Replace :

WEBMAIL_PATH = ../tools/webmail/

By :

WEBMAIL_PATH = http://webmail.DOMAIN.TLD

Replace :

PMA_PATH = ../tools/pma/

By :

PMA_PATH = http://pma.DOMAIN.TLD

Replace :

FILEMANAGER_PATH = ../tools/filemanager/

By :

FILEMANAGER_PATH = http://webftp.DOMAIN.TLD

Save & close.

Open :

vim /var/www/ispcp/gui/index.php

Replace :

'TR_WEBMAIL_SSL_LINK'       => "webmail",
'TR_FTP_SSL_LINK'           => "ftp",
'TR_PMA_SSL_LINK'           => "pma",

By :

'TR_WEBMAIL_SSL_LINK'       => isset($_SERVER['HTTPS']) ? 'https://webmail.DOMAIN.TLD' : 'http://webmail.DOMAIN.TLD',
'TR_FTP_SSL_LINK'           => isset($_SERVER['HTTPS']) ? 'https://webftp.DOMAIN.TLD' : 'http://webftp.DOMAIN.TLD',
'TR_PMA_SSL_LINK'           => isset($_SERVER['HTTPS']) ? 'https://pma.DOMAIN.TLD' : 'http://pma.DOMAIN.TLD',

Regenerating ispCP files

First, we remove the old copies of ispcp.conf :

rm /etc/apache2/sites-available/ispcp.conf
rm /etc/ispcp/apache/working/ispcp.conf

We regenerate the files now :

cp /etc/ispcp/apache/parts/ispcp_base.tpl /etc/apache2/sites-available/ispcp.conf
cp /etc/ispcp/apache/parts/ispcp_base.tpl /etc/ispcp/apache/working/ispcp.conf

Stopping ispCP :

/etc/init.d/ispcp_daemon stop

Logon to MySQL :

 mysql -u root -p

In MySQL command prompt type :

USE ispcp;
UPDATE `domain` SET `domain_status` = 'change' WHERE `domain_status` = 'ok';
UPDATE `subdomain` SET `subdomain_status` = 'change' WHERE `subdomain_status` = 'ok';
UPDATE `domain_aliasses` SET `alias_status` = 'change' WHERE `alias_status` = 'ok';
UPDATE `mail_users` SET `status` = 'change' WHERE `status` = 'ok';

Quit MySQL :

quit

Process the request :

/var/www/ispcp/engine/ispcp-rqst-mngr

Start ispCP daemon :

/etc/init.d/ispcp_daemon start

There, you're done! Now you can access ispCP and its various tools (PhpMyAdmin, Filemanager, Webmail, etc..) at the following addresses :

Credits go to : http://nuxwin.com/articles/view.php/42; Kommius