LoadModule fcgid_module modules/mod_fcgid.so

DefaultInitEnv O4W_QT_PREFIX "C:\OSGeo4W/apps/Qt5"
DefaultInitEnv O4W_QT_BINARIES "C:\OSGeo4W/apps/Qt5/bin"
DefaultInitEnv O4W_QT_PLUGINS "C:\OSGeo4W/apps/Qt5/plugins"
DefaultInitEnv O4W_QT_LIBRARIES "C:\OSGeo4W/apps/Qt5/lib"
DefaultInitEnv O4W_QT_TRANSLATIONS "C:\OSGeo4W/apps/Qt5/translations"
DefaultInitEnv O4W_QT_HEADERS "C:\OSGeo4W/apps/Qt5/include"
DefaultInitEnv O4W_QT_DOC "C:\OSGeo4W/apps/Qt5/doc"

DefaultInitEnv PATH "C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\bin;C:\OSGeo4W\apps\qgis-ltr\bin;C:\OSGeo4W\apps\grass\@grasspath@\bin;C:\OSGeo4W\apps\grass\@grasspath@\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
DefaultInitEnv QGIS_PREFIX_PATH "C:\OSGeo4W\apps\qgis-ltr"
DefaultInitEnv QT_PLUGIN_PATH "C:\OSGeo4W\apps\qgis-ltr\qtplugins;C:\OSGeo4W\apps\qt5\plugins"
DefaultInitEnv TEMP "C:\Users\AIMPLE~1\AppData\Local\Temp"
DefaultInitEnv PYTHONHOME "C:\OSGeo4W\apps\Python37"
DefaultInitEnv PYTHONPATH "C:\OSGeo4W\apps\qgis-ltr\python;C:\OSGeo4W\apps\Python37;C:\OSGeo4W\apps\Python37\Scripts"

FcgidInitialEnv QGIS_SERVER_LOG_FILE c:\qgis\qgisserver.log
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 1

# Plugins path config
FcgidInitialEnv QGIS_PLUGINPATH C:\qgis\plugins

Alias /qgis-ltr/ C:\OSGeo4W/apps/qgis-ltr/bin/

<Directory "C:\OSGeo4W/apps/qgis-ltr/bin/">
    SetHandler fcgid-script
    Options ExecCGI
    Order allow,deny
    Allow from all
	
	AuthType Basic
    AuthName "Restricted QGIS Service"
    AuthUserFile c:\qgis\htpasswd
    Require valid-user
</Directory>

<IfModule mod_fcgid.c>
    FcgidMaxRequestLen 26214400
    FcgidConnectTimeout 60
    RewriteEngine on
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
