-
Notifications
You must be signed in to change notification settings - Fork 17
Install CacoCloud on Windows with IIS
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
- IIS role
- PHP windows build
- URL Rewrite module
- Download CA Certificate PEM file for use by php_curl to avoid SSL certificate errors when fetching data from the Internet
- Linked file is from cURL's official website, see Automatically converted CA certs from Mozilla.org for more information
- Save into PHP install folder
- Update php.ini file with:
curl.cainfo = "full\path\to\cacert.pem"
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
- Download the CacoCloud tar.gz files from the homepage and extract into a folder outside the wwwroot. I used
C:\inetpub\cacocloud
. - Create an application pointing to the
public
subfolder in the newly created folder. - Ensure the account used by the application has read rights to the entire cacocloud folder. Modify rights are only needed on the
database
folder, theinstall
folder, and the 2 subfolders within theicons
folder. The install steps double-check this as well. - Add the URL Rewrite rules specified at the end of this document to the following folder locations:
public\api\1
,public\install
, andvendor\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. - Verify PHP is allowed to accept all necessary verbs
- Handler Mappings
- Right-click PHP entry, select Edit
- Request Restrictions button
- Verbs tab
- Verify
GET
andPOST
are in the list, add if necessary - Add
DELETE
andPUT
to the list (or selectALL
verbs)
- 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
- 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 thepublic\install
folder. - Delete the
install
folder once it has completed. - 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>