Qgis server installation on debian 11

Hello everyone, i have an issue about qgis server 3.38 (same with 3.34). Have followed instruction reported in the installation guide from qgis site, but receive this error when test:
root@debian:~# /usr/lib/cgi-bin/qgis_mapserv.fcgi
Application path not initialized
Application path not initialized
Application path not initialized
Application path not initialized
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.“Loading native module /usr/lib/qgis/server/liblandingpage.so”
“Loading native module /usr/lib/qgis/server/libwcs.so”“Loading native module /usr/lib/qgis/server/libwfs.so”
“Loading native module /usr/lib/qgis/server/libwfs3.so”“Loading native module /usr/lib/qgis/server/libwms.so”
"Loading native module /usr/lib/qgis/server/libwmts.so"Content-Length: 0
Location: http:/index.jsonServer: QGIS FCGI server - QGIS version 3.38.2-Grenoble
Status: 302

Coudl someone tell me where to find an how to guide for solve my issue? i’m newbe to this world and wish to learn. I wrote to italian group but no answare have received (May be i made some mistakes for my topic?)

Please help me. My regards

Hi @Kahnswrath have you set the parameters in your apache/nginx virtualhost in order to grant the server correctly run on?
Mine it’s rn on apache and I configured the path parameters in /etc/apache2/sites-enabled/myhost.conf that contain the below configurations:

# if qgis-server is installed from packages in debian based distros this is usually /usr/lib/cgi-bin/
  # run "locate qgis_mapserv.fcgi" if you don't know where qgis_mapserv.fcgi is
  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin/">
    AllowOverride None
    Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
    Require all granted
  </Directory>

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

and of course I activated this vhost by

a2enconf /path/to/yourvhost.conf
a2ensite /path/to/yourvhost.conf

this in apache server, of course a similar configuration is needed for nginx
cheers