[QGIS-Developer] strange files in bin when building qgis server

Greg Troxel gdt at lexort.com
Fri Aug 25 04:00:52 PDT 2023


Greg Troxel writes:

> The patch basically does:
>
> +CMAKE_ARGS+=           -DWITH_SERVER:BOOL=TRUE
>
> which as you'd expect adds that to the cmake invocation.
>
> Things are mostly ok; now new files appear in $prefix/bin, in lib and in
> share and reviewing the list most seem obviously sensible.
>
> However, two files get installed in bin: admin.sld and wms_metadata.xml.

I have read the docs at:

  INSTALL.md in the 3.28 sources
  https://docs.qgis.org/3.28/en/docs/server_manual/index.html

and none of them say anything about qgis server installation, other than
'go find binary packages and add them'.   I am of course trying to
create a binary package by building from source :-)

Reading the sources, it seems there is a default to overlay cgibin into bin:

      set (DEFAULT_BIN_SUBDIR     bin)
      set (DEFAULT_CGIBIN_SUBDIR  bin)

which is puzzling, because normal webserver practice is to limit cgi to
a separate directory, so that only programs intended for cgi can be run.

Further, it seems that admin.sld and wms_metadata.xml are installed in
cgibin, which also seems wrong because they belong in a webroot, not the
directory with the cgi executables.  So really we another definition for
that, and I don't see any variables that fit.

It seems obvious (dangerous I know) that cgibin should default to
libexec/cgi-bin instead.  This is where php installs things, by default
if I read our package correctly as not forcing it.

It's not entirely clear to me if these two files are examples, that the
user will have to modify for their particular use, or if they are meant
to be used as is and never modified.  Packaging treats those two cases
separately; one going in share/examles/qgis/server and the other
requiring a share/qgis/server/webroot.

issue for docs not explanining the big picture:

  https://github.com/qgis/QGIS-Documentation/issues/8475


More information about the QGIS-Developer mailing list