Installation on server

Receive data

  • Create an ssh user “deployment” to receive data
  • Create a package directory - it can be outside webroot eg. /var/www/cipkg.example.com/packages/ with write permissions for user “deployment” and read permissions for webserver.
mkdir /var/www/cipkg.example.com/packages/
chown deployment:www-data /var/www/cipkg.example.com/packages/
chmod 750 /var/www/cipkg.example.com/packages/

In the config of CI web server add a sync target. Use

  • the deployment user as ssh
  • the fqdn as hostname
  • the defined packagedir in your inc_config.php as target directory

Xsentfile module

On Apache Webserver install xsendfile module.

i.e. on CentOS

yum install mod_xsendfile

Configuration of vhost

In the Apache vhost for cipkg server set the XSendFilePath - it is an absolute path on your websever.

Redirect all requests to /packages/[whatever] to /packages/index.php

Example snippet


    XSendFile On
    XSendFilePath "/var/www/cipkg.example.com/packages/"

    <Location "/packages">

        # for Php as php-fpm service:
        SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php [QSA,L]

    </Location>