User talk:Krokodox

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

wpkgExpress on IIS

wpkgExpress does not run under IIS6 on Windows 2003 out-of-the-box. I spent half a day seraching the net and finding the right settings / software, hopefully my solution can help others.

wpkgExpress was developed using the CakePHP [1] framework which seems to be better integrated with Apache than with IIS. Especially if one wants to install the application in a virtual directory instead of as a whole site.

My setup has f:\wpkg as the main Windows share for WPKG. I downloaded and extracet all files for wpkgExpress in a subdirectory under this: f:\wpkg\wpkgExpress. This directory was added to IIS6 as a virtual directory in order to be accessible from http://www.krokodox.com/wpkg but this did not work at all, CakePHP refused to send any pages.

Some pages on the net suggests to implement something that works like Apache's mod_rewrite on IIS as an ISAPI filter but I found out that this is unnecessary.

Instead I just had to tweak some setting in the .PHP files and now it works like a charm!


Tweaking CakePHP

In order to get CakePHP to run happily under a virtual directory under a website in IIS I had to make several adjustments.

The most important one was to make CakePHP not to use the mod_rewrite that IIS lacks. This made wpkgExpress accessible but it rendered without .CSS and images:

  • Edit wpkgExpress\config\core.php, uncomment the Configure::write('App.baseUrl', env('SCRIPT_NAME')) line.


CakePHP insisted on adding the subdirectoryname (\wpkgExpress\) to the URL which meant that no .CSS or .JPG / .PNG / .GIF files were found by the browser. I worked around this by commenting out one line where this directoryname is added to all URL's:

  • Edit wpkgExpress\cake\dispatcher.php, comment out the line containing "$this->webroot .= $dir . '/'" in the function baseUrl() declaration, it is found on line 382 in the file.


Once this was working I turned on CakePHP debugging and noticed that it was not able to load some includefiles even though the path reference was OK. It turns out that CakePHP modifies PHP's "include_path" setting in PHP.INI which collides with the relativepath reference that some files have added to their include_once() directive. Remove the "..\" preceding the filename in the following files, the include_once() directive is found at the beginning of these files:

  • wpkgExpress\controllers\variables_controller.php
  • wpkgExpress\controllers\profiles_controller.php
  • wpkgExpress\controllers\packages_controller.php
  • wpkgExpress\controllers\hosts_controller.php
  • wpkgExpress\controllers\admin_controller.php
  • wpkgExpress\models\variable.php
  • wpkgExpress\models\profile.php
  • wpkgExpress\models\exit_code.php
  • wpkgExpress\models\package.php


After these modifications wpkgExpress started up nicely and is now up and running.