Windows/IIS

Setting Up an IIS Website

📘

NOTE:

For the purposes of this walkthrough, we are assuming you're using assets.portal.local as your Snipe-IT local domain name. This should be changed for your own installation.

  • Extract Snipe-IT to C:\inetpub\wwwroot\snipe-it (folder name can be changed but we will reference it as is shown here)
  • Run IIS Manager
  • Right Click Sites and Add Website (See settings below)
  • Click OK
Site name: Snipe IT
Physical path: C:\inetpub\wwwroot\snipe-it\public
Binding
Type: http
IP address: All Unassigned or a specific IP if you have one you will be using
Port: 80 or any you wish to use
Host name: assets.portal.local

Your site will now appear in the list.

Enable Additional HTTP verbs for api and frontend usage

IIS may not enable the DELETE, PUT, or PATCH verb by default. The following steps are necessary:
See #5034 for further details

  • Enter IIS Manager
  • Select your site.
  • Open "Handler Mappings"
  • Select PHP mappings (there may be more than one) and open it.
  • Click on "Request Restrictions" and select the "Verbs" Tab
  • Add DELETE,PUT,PATCH to the list of verbs so that it reads "GET,HEAD,POST,DELETE,PUT,PATCH"
  • Save the changes.
  • Do this for all php mappings listed.

Fix Permissions

Add permissions for the IIS user for the uploads folder:

  • Go to C:\inetpub\wwwroot\snipe-it\public
  • Right Click uploads Properties
  • Go to the Security Tab Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR full control
  • Click OK twice

Add permissions for the IIS user for the cache folder:

  • Go to C:\inetpub\wwwroot\snipe-it\bootstrap
  • Right Click cache Properties
  • Go to the Security Tab Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR full control
  • Click OK twice

Add permissions for the IIS user for the storage folder:

  • Go to C:\inetpub\wwwroot\snipe-it\
  • Right Click storage Properties
  • Goto Security Tab Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR modify permissions
  • Click OK twice

Add permissions for the IIS user for the Windows Temp folder:

  • Go to C:\Windows\
  • Right Click temp Properties
  • Go to the Security Tab Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR modify permissions
  • Click OK twice

📘

NOTE:

Previous versions of Snipe-IT on IIS required you to import the .htaccess file to create the rewrite rules, however v3.0 and higher include a web.config file that handles those rules for you, so that step is no longer necessary.

Set Additional Handler Mappings

Since Snipe-IT consumes its own API in some cases, you'll need to add additional Handler Mappings for some lesser-known HTTP verbs.

  • Enter IIS Manager
  • Select your site
  • Open Handler Mappings

Select a PHP mapping (there may be more than one) and open it:

Click on Request Restrictions

  • Select the Verbs Tab
  • Add DELETE,PUT,PATCH to the list of verbs so that it reads GET,HEAD,POST,DELETE,PUT,PATCH

Save the changes.

If you receive this error...

... then add double quotes around the Executable (optional): field

Click Yes for Fast-CGI message:

Repeat for all remaining php mappings listed.

Much to @madd15 for writing up the original Windows installation guide, and to @colinerd for the screenshots and documentation on the Handler Mappings.

Backup & Windows Environments

/admin/backup and CLI php artisan snipeit:backup require the following additional changes to be made in order to create the MySQL backup files:

  • IUSR permissions on C:\windows\temp
  • path to mysqldump.exe in the .env file's DB_DUMP_PATH=

The path placed within the .env file MUST be "old-school" DOS 8.3 compliant in order for mysqldump.exe to work. This means the process will fail if there are any spaces in a path such as:

C:\Program Files\MySql\MySQL Server 5.7\bin

To make this path 8.3 compliant, use this script:

cmd /c for %A in ("C:\Program Files\MySql\MySQL Server 5.7\bin") do @echo %~sA

Which will output a path similar to:

C:\Progra~1\MySQL\MySQL~2.7\bin

As with any Windows path, we have to double-up on the \ when adding it to the .env. The end result will look like:

DB_DUMP_PATH=C:\\Progra~1\\MySQL\\MySQL~2.7\\bin

With the above steps done, you may now test it via a console command. Open a cmd prompt:

cd \Inetpub\wwwroot\snipe-it
php artisan snipeit:backup

These backups are located in storage/apps/backup/, and are also manageable via your site via [Snipe-URL]/admin/backups.


Did this page help you?