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 persmissions 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/
  • Configue the ci sever to rsync with ssh user “deployment” here

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">

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

    </Location>