3.5.3. Microsoft IIS

Bugzilla works with IIS as a normal CGI application. These instructions assume that you are using Windows 7 or Windows 10. Procedures for other versions are probably similar.

Begin by starting Internet Information Services (IIS) Manager. Start --> Administrators Tools --> Internet Information Services (IIS) Manager. Or run the command:

inetmgr

3.5.3.1. Create a New Application

Expand your Server until the Default Web Site shows its children.

Right-click Default Web Site and select Add Application from the menu.

Unde Alias, enter the alias for the website. This is the path below the domain where you want Bugzilla to appear.

Under Physical Path, enter the path to Bugzilla, C:\Bugzilla.

When finished, click OK.

3.5.3.2. Configure the Default Document

Click on the Application that you just created. Double-click on Default Document, and click Add underneath the Actions menu.

Under Name, enter index.cgi.

All other default documents can be removed for this application.

Warning

Do not delete the default document from the Default Website.

3.5.3.3. Add Handler Mappings

Ensure that you are at the Default Website. Under IIS, double-click Handler Mappings. Under Actions, click Add Script Map. You need to do this twice.

For the first one, set the following values (replacing paths if necessary):

  • Request Path: *.pl
  • Executable: C:\Perl\bin\perl.exe "%s" %s
  • Name: Perl Script Map

At the prompt select Yes.

Note

The ActiveState Perl installer may have already created an entry for .pl files that is limited to GET,HEAD,POST. If so, this mapping should be removed, as Bugzilla's .pl files are not designed to be run via a web server.

For the second one, set the following values (replacing paths if necessary):

  • Request Path: *.cgi
  • Executable: C:\Perl\bin\perl.exe "%s" %s
  • Name: CGI Script Map

At the prompt select Yes.

3.5.3.4. Bugzilla Application

Ensure that you are at the Bugzilla Application. Under IIS, double-click Handler Mappings. Under Actions, click Add Script Map.

Set the following values (replacing paths if necessary):

  • Request Path: *.cgi
  • Executable: C:\Perl\bin\perl.exe -x"C:\Bugzilla" -wT "%s" %s
  • Name: Bugzilla

At the prompt select Yes.

Now it's time to restart the IIS server to take these changes into account. From the top-level menu, which contains the name of your machine, click Restart under Manage Server. Or run the command:

iisreset

3.5.3.5. Enable Rewrite Rules for REST

REST URLs are usually of the form http://.../bugzilla/rest/version instead of http://.../bugzilla/rest.cgi/version. To let IIS redirect rest/ URLs to rest.cgi, you need to download and install the URL Rewrite extension for IIS. Direct download links are available at the bottom of the page for both x86 and x64 Windows.

Once installed, you open the IIS Manager again and go to your Bugzilla Application. From here, double-click URL Rewrite. Then click Add Rule(s) under the Actions menu and click Blank rule in the Inbound rules section.

Fill the fields as follows. Other fields do not need to be edited.

  • Name: REST
  • Pattern: ^rest/(.*)$
  • Rewrite URL: rest.cgi/{R:1}

There is no need to restart IIS. Changes take effect immediately.

3.5.3.6. Common Problems

Bugzilla runs but it's not possible to log in

You've probably configured IIS to use ActiveState's ISAPI DLL -- in other words you're using PerlEx, or the executable IIS is configured to use is PerlS.dll or Perl30.dll.

Reconfigure IIS to use perl.exe.

IIS returns HTTP 502 errors
You probably forgot the -T argument to perl when configuring the executable in IIS.

This documentation undoubtedly has bugs; if you find some, please file them here.