I keep getting the 403 error and I have followed the directions from here. Anyone know what's wrong?

Adding QGIS Server to an existing Windows web server

I set the httpd_gis.conf to require all granted

<pre>LoadModule fcgid_module modules/mod_fcgid.so</pre>

FcgidInitialEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\grass\grass-6.4.3\bin;C:\OSGeo4W64\apps\grass\grass-6.4.3\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" DefaultInitEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis" DefaultInitEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis\qtplugins;C:\OSGeo4W64\apps\qt4\plugins" DefaultInitEnv TEMP "C:\Users\mtenold\AppData\Local\Temp"

Alias /qgis/ C:\OSGeo4W64/apps/qgis/bin/

<Directory "C:\OSGeo4W64/apps/qgis/bin/">
    #SetHandler fcgid-script
    SetHandler cgi-script
    Options ExecCGI     Require all granted </Directory>

and I copied the httpd_gis.conf into the apache\httpd.d folder. However when I try and run this request http://localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

I get the 403 error

If I type localhost into the browser, I see the screen that says "It works". So I know the Apache server is working.

  • This is the request I am using that gets the 403 error. localhost/qgis/…
    – mapman
    Oct 28, 2015 at 14:59
  • Do you actually have <pre> tags in your conf file, or is that just an attempt at code formatting?
    – nmtoken
    Sep 14, 2016 at 17:19

2 Answers 2


This worked fine on my windows2008 r2. Take care of the paths.

LoadModule cgi_module modules/mod_cgi.so

SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\grass\grass-6.4.3\bin;C:\OSGeo4W64\apps\grass\grass-6.4.3\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis\qtplugins;C:\OSGeo4W64\apps\qt4\plugins"
SetEnv TEMP "C:\Users\ADMINI~1\AppData\Local\Temp"

Alias /qgis/ C:\OSGeo4W64/apps/qgis/bin/<Directory "C:\OSGeo4W64/apps/qgis/bin/">
    SetHandler cgi-script
    Options ExecCGI
    Require all granted

Have you also defined your httpd_qgis.conf in your httpd.conf of your Apache configuration?

Example: Include conf/extra/httpd_qgis.conf

After that restart your Apache !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.