The default port for the Open Build Service for the published repositories is 82.

If you are using the Internet through an http proxy, this can cause trouble, as it did for me when I wanted to install from the OBS run by KolabSystems, for installing Kolab from OBS: Downloading from the URL does not work.

The solution is to setup a small php script on a server somewhere on the Internet, that does not have the restrictions of port 82.

In my sample configuration, I use a Debian server with Lighttpd and PHP.


apt-get install lighttpd spawn-fcgi php5-curl php5-cgi

changes to /etc/lighttpd/lighttpd.conf:

server.modules = (
fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/bin/php5-cgi",
                     "socket" => "/tmp/php.socket",
                     "max-procs" => 2,
                     "bin-environment" => (
                       "PHP_FCGI_CHILDREN" => "16",
                       "PHP_FCGI_MAX_REQUESTS" => "10000"
                     "bin-copy-environment" => (
                       "PATH", "SHELL", "USER"
                     "broken-scriptfilename" => "enable"
url.rewrite-once = (
    "^/obs\.kolabsys\.com/index.php" => "$0",
    "^/obs\.kolabsys\.com/(.*)" => "/$1"

and in /var/www/

// it seems file_get_contents does not return the full page
function curl_get_file_contents($URL)
    $c = curl_init();
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($c, CURLOPT_URL, str_replace('&#038;', '&#038;', $URL));
    $contents = curl_exec($c);
    if ($contents) return $contents;
    else return FALSE;
$page = $_GET['page'];
$filename = basename($page);
$content = curl_get_file_contents("".$page);
if (substr($page, -strlen("/")) === "/")
        # print directory listing
        $content = str_replace("", "", $content);
        $content = str_replace('href="/', 'href="', $content);
        echo $content;
else if (substr($filename, -strlen(".repo")) === ".repo")
        header("Content-Type: plain/text");
        echo str_replace("", "", $content);
        header("Content-Type: application/octet-stream");
        header('Content-Disposition: attachment; filename="'.$filename.'"');
        header("Content-Transfer-Encoding: binary\n");
        echo curl_get_file_contents("".$page);

Now it is possible to download the repo files like this:

cd /etc/yum.repos.d/
yum install kolab

This works for all other projects and distributions on too.

Feel free to use my “mirror”, but also consider to set it up for yourself, if you are using it extensively!

Downloading from OBS repo via php proxy file
Tagged on: