Skip to content

Install CacoCloud on Windows with IIS

jrtolle edited this page Jun 13, 2014 · 4 revisions

Install CacoCloud on Windows with IIS. Steps taken on Windows 2012 with IIS 8, but should work on Windows 2008/IIS 7+ - 2012 R2/IIS 8.5. This guide assumes knowledge of IIS management, including configuring SSL on IIS (link shows how to setup SSL on IIS, including creating a self-signed certificate).

###Install Needed Packages

Alternatively, after IIS is installed, WebPI can be used to install both PHP and the URL Rewrite Module and any dependencies (other than the CA Cert PEM file). NOTE: Application Request Routing is NOT required to use the URL Rewrite module on its own, so feel free to remove it if it is added as a dependency.

(Optional) For easy management of PHP directly within the IIS management console, I recommend using PHP Manager. It works in IIS7-8 (Windows 2008-2012), but it does not work in 2012 R2/IIS 8.5. As it has been abandoned, users will have to resort to normal php.ini management in 2012 R2+.

###Install CacoCloud and Configure IIS

  1. Download the CacoCloud tar.gz files from the homepage and extract into a folder outside the wwwroot. I used C:\inetpub\cacocloud.
  2. Create an application pointing to the public subfolder in the newly created folder.
  3. Ensure the account used by the application has read rights to the entire cacocloud folder. Modify rights are only needed on the database folder, the install folder, and the 2 subfolders within the icons folder. The install steps double-check this as well.
  4. Add the URL Rewrite rules specified at the end of this document to the following folder locations: public\api\1, public\install, and vendor\slim. .htaccess files should be present in these locations as well. The URL Rewrite module GUI within the IIS management console can also be used to manually create rules or to import the Rewrite rules specified in the .htaccess files.
  5. Verify PHP is allowed to accept all necessary verbs
    1. Handler Mappings
    2. Right-click PHP entry, select Edit
    3. Request Restrictions button
    4. Verbs tab
    5. Verify GET and POST are in the list, add if necessary
    6. Add DELETE and PUT to the list (or select ALL verbs)
  6. If WebDAV is installed and enabled on the server, remove the module for the CacoCloud directory/site.

NOTE: Handler Mappings and Module Settings are stored in the system-wide applicationHost.config. If you know what that is, feel free to edit it, otherwise I recommend sticking to using the IIS Management Console.

###Configuring CacoCloud

  1. Access your website by going to <siteroot>\install\. This will start the installation. Follow the steps. If any of the Next buttons fail to move you to the next page, check your URL Rewrite rules for the public\install folder.
  2. Delete the install folder once it has completed.
  3. To add additional users, drop to the CLI and run this command (which assumes PHP is in PATH; if not, type the full path of the PHP executable) from within the cacocloud folder created earlier: php.exe cli\run_cli.php --cli="Caco\Slim\Auth\UserManagement" -a create -u <USER_NAME> -p <PASSWORD>.

###web.config Examples This is the entire contents of the web.config file for the URL Rewrite rule. If you feel you need more rules for other modules, or have existing rules, just use the section.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
Clone this wiki locally