Update for QGIS 3.4:

Change line

SetEnv PYTHONHOME “C:\OSGeo4W64\apps\Python36”

To line
SetEnv PYTHONHOME “C:\OSGeo4W64\apps\Python37”

Let’s try to setup brand new QGIS Server 3.0 on Windows 10 and Apache Web Server.

Apache

Download XAMPP distribution  (you will also install PHP, probably you need it anyway). You can remove all other options as only installing Apache and PHP.


Test for Apache and PHP

 

QGIS Server 3.0

Download 64 bit OSGeo4W installer . Choose advanced installation, from web and then select QGIS Server from Web part. I also needed QGIS Desktop on that machine so I checked also QGIS Desktop.

Apache configuration

Edit httpd.conf file. In case of XAMPP you get Control Panel where it is really simple to do that.

ScriptAlias

change line:

ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"

to:

ScriptAlias /cgi-bin/ "c:/OSGeo4W64/apps/qgis/bin/"

QGIS Server configuration

change part:

<Directory "C:/xampp/cgi-bin"
  AllowOverride None
  Options None
  Require all granted
</Directory>

to:

<Directory "c:/OSGeo4W64/apps/qgis/bin">
  SetHandler cgi-script
  AllowOverride None
  Options ExecCGI
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

Cgi handler

change line:

AddHandler cgi-script .cgi .pl .asp

to:

AddHandler cgi-script .cgi .pl .exe

Variables

insert at bottom of http.conf:

SetEnv GDAL_DATA "C:\OSGeo4W64\share\gdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:\OSGeo4W64\apps\qgis\resources"
SetEnv PYTHONHOME "C:\OSGeo4W64\apps\Python36"
SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\Qt5\bin;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\Qt5\plugins"

That completes Apache configuration.

Test

Restart Apache server (from XAMPP Control Panel) and open a GetCapabilities request to QGIS Server

http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

You should receive standard WMS Capabilities XML response from QGIS Server.