The SimpleRisk API was first introduced in the SimpleRisk 2061023-001 release. Please note these instructions were intended for Ubuntu operating systems and commands and file paths may vary for different OS please contact us if you need any assistance at support@simplerisk.com.  To get SimpleRisk to work properly, you will need to do the following:



For Apache:

1) Enable mod_rewrite by running the command "a2enmod rewrite".

2) Open the file containing the Apache site configuration.  This is likely found under /etc/apache2/sites-enabled.

3) Find the "Directory" section for your simplerisk site and add a line at the top for "AllowOverride all".  It should look something like this:


<Directory "/var/www/simplerisk">      
        AllowOverride all                          
        allow from all                                
        Options -Indexes                          
</Directory>         


4) Restart Apache by running the command "service apache2 restart".


For Nginx:

1) Make sure the HttpRewriteModule is installed.

2) Specify the following inside of the SimpleRisk server configuration:


location ~ /api {
  if (!-e $request_filename) {
    rewrite ^/api/(.*) /api/index.php?__route__=$1 last;
  }
}

If for any reason the first configuration does not work please try and replace the previous configuration with this one.


  location ~ /api {
        if (!-e $request_filename) {
            rewrite ^/api(.*) /api/index.php?__route__=$1 last;
        }
    }



For IIS:

1) Make sure the URL Rewrite Module is installed.

2) Specify the following inside of the web.config file inside the SimpleRisk web root:


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="epiphany" patternSyntax="Wildcard">
                    <match url="api/*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="api\index.php?__route__=/{R:1}" appendQueryString="true" logRewrittenUrl="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>