Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On 4/15/20 11:44 AM, Alessandro Pasotti wrote: > On Wed, Apr 15, 2020 at 11:39 AM Franko Naimarevic >>> What am I missing? >> >> The web server component (apache or nginx or any other webserver you >> can plug FCGI into). >> >> FCGI binary is not an HTTP server. > >I think Franko does have a running Apache webserver: in XAMPP the A >stands for Apache? > Yes, Apache is running through XAMPP! The XAMPP Control Panel shows it is running with no errors. >> If you have QGIS 3.12 you can try the standalone development server (I >> have not tested it on windows but it may work), the executable name >> should be qgis_mapserver.exe. > >@Allesandro: you say a standalone development server. But (even on >windows) it's not that you run a webserver on port 80 if you run >qgis_mapserver or qgis_mapserver.exe, is it? If I run it here it's >initing all QGIS machinery and ends with: >INFO Server[178177]: No server python plugins are available >seemingly waiting for a connection, but I do not know how > >To make more clear to Franko: QGIS comes with 2 mapservers: >- a fastcgi module and a (simple) (you need mod_fastcgi (or something >like that for it) >- a cgi module: qgis_mapserver.exe is the simple cgi version. > >The last one is easiest, IF the environment of apache is ok, you should >be able to put this in your cgi-bin dir of apache. > >To set the right environment, you could have a look into the >osgeo4w64\httpd.d\httpd_qgis.conf (which comes with an osgeo4w64 install >of qgis-server) which has most of the apache-config rules you need: > >DefaultInitEnv O4W_QT_PREFIX "C:\OSGeo4W64/apps/Qt5" >DefaultInitEnv O4W_QT_BINARIES "C:\OSGeo4W64/apps/Qt5/bin" >DefaultInitEnv O4W_QT_PLUGINS "C:\OSGeo4W64/apps/Qt5/plugins" >DefaultInitEnv O4W_QT_LIBRARIES "C:\OSGeo4W64/apps/Qt5/lib" >DefaultInitEnv O4W_QT_TRANSLATIONS "C:\OSGeo4W64/apps/Qt5/translations" >DefaultInitEnv O4W_QT_HEADERS "C:\OSGeo4W64/apps/Qt5/include" >DefaultInitEnv O4W_QT_DOC "C:\OSGeo4W64/apps/Qt5/doc" > >DefaultInitEnv PATH >"C:\OSGeo4W64\apps\qt5\bin;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\grass\@grasspath@\bin;C:\OSGeo4W64\apps\grass\@grasspath@\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\qt5\plugins" >DefaultInitEnv TEMP "C:\Users\richa\AppData\Local\Temp" >DefaultInitEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37" >DefaultInitEnv PYTHONPATH >"C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\Scripts" > >Alias /qgis/ C:\OSGeo4W64/apps/qgis/bin/ > > >SetHandler fcgid-script >Options ExecCGI > # Order/Allow is for Apache 2.2 >#Order allow,deny >#Allow from all ># Require is for Apache 2.4 >Require all granted > > >Off course this should all match your paths, but given this your cgi (or >fastcgi) should be able to find all stuff needed to run qgis-server. > >Easiest way for me was to run an apache with modfcgi in it, install >qgis-server with osgeo4w64 and then just 'include' the httpd_qgis.conf >in your httpd.conf > My osgeo4w64\httpd.d\httpd_qgis.conf contains everything you have written here. I'm sorry but I didn't quite understand what I should do in order to solve my "Project file error" problem? -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On Wed, Apr 15, 2020 at 1:53 PM Richard Duivenvoorde wrote: > > On 4/15/20 1:40 PM, Alessandro Pasotti wrote: > > >> Is it an idea (feature request?) to let qgis_mapserver.exe spit out an > >> INFO-message line telling the user that "Started a minimal http-server > >> on localhost port 8000 for testing purposes" or so? > >> OR is the code itself not aware it is being ran as a standalone http dev > >> server at that moment? > > > > That's what it is supposed to do: > > https://github.com/qgis/QGIS/blob/master/src/server/qgis_mapserver.cpp#L208 > > > > I've no idea why you don't see it on windows. > > Ok it is there, but just buried beneath all other output... > What about moving those lines to: > > https://github.com/qgis/QGIS/blob/master/src/server/qgis_mapserver.cpp#L241 > > (/me thinking server.initPython() is the line that gave me the output: > "INFO Server[178177]: No server python plugins are available" > So if the server is 'waiting' for connections it is actually showing > that info. > > Happy to do a pr if you want :-) Yes please, sounds better. But notice that there is actually a difference: all the debug info goes to stderr, and the "listening" message goes to stdout. You can actually silence all QGIS server internal debugging and logging info by redirecting stderr to a file or /dev/null, you will get only the output from the application which goes to stdout. That was what I had in mind when I designed it. > > Regards, > > Richard > -- Alessandro Pasotti w3: www.itopen.it ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On 4/15/20 1:40 PM, Alessandro Pasotti wrote: >> Is it an idea (feature request?) to let qgis_mapserver.exe spit out an >> INFO-message line telling the user that "Started a minimal http-server >> on localhost port 8000 for testing purposes" or so? >> OR is the code itself not aware it is being ran as a standalone http dev >> server at that moment? > > That's what it is supposed to do: > https://github.com/qgis/QGIS/blob/master/src/server/qgis_mapserver.cpp#L208 > > I've no idea why you don't see it on windows. Ok it is there, but just buried beneath all other output... What about moving those lines to: https://github.com/qgis/QGIS/blob/master/src/server/qgis_mapserver.cpp#L241 (/me thinking server.initPython() is the line that gave me the output: "INFO Server[178177]: No server python plugins are available" So if the server is 'waiting' for connections it is actually showing that info. Happy to do a pr if you want :-) Regards, Richard ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On Wed, Apr 15, 2020 at 1:32 PM Richard Duivenvoorde wrote: > > On 4/15/20 12:50 PM, Alessandro Pasotti wrote: > > >> @Allesandro: you say a standalone development server. But (even on > >> windows) it's not that you run a webserver on port 80 if you run > >> qgis_mapserver or qgis_mapserver.exe, is it? > > > > Yes, it's a full standalone HTTP development server. > > > >> If I run it here it's > >> initing all QGIS machinery and ends with: > >> INFO Server[178177]: No server python plugins are available > >> seemingly waiting for a connection, but I do not know how > > > > try calling it with '-h' > > Ah, duh... thanks... > > YES, so it run's by default on port localhost:8000 > > And it is also working (tested) on Windows: > > Saving a simple project into c:\tmp > Starting qgis_mapserver.exe > And in browser I go to: > http://localhost:8000/?map=c:\tmp\nl.qgs&service=WMS&request=getcapabilities > And I have a valid capabilities document! > > Thanks Ale! Works like a charm ( even on Windooz ;-) ) > > Is it an idea (feature request?) to let qgis_mapserver.exe spit out an > INFO-message line telling the user that "Started a minimal http-server > on localhost port 8000 for testing purposes" or so? > OR is the code itself not aware it is being ran as a standalone http dev > server at that moment? That's what it is supposed to do: https://github.com/qgis/QGIS/blob/master/src/server/qgis_mapserver.cpp#L208 I've no idea why you don't see it on windows. -- Alessandro Pasotti w3: www.itopen.it ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On 4/15/20 12:50 PM, Alessandro Pasotti wrote: >> @Allesandro: you say a standalone development server. But (even on >> windows) it's not that you run a webserver on port 80 if you run >> qgis_mapserver or qgis_mapserver.exe, is it? > > Yes, it's a full standalone HTTP development server. > >> If I run it here it's >> initing all QGIS machinery and ends with: >> INFO Server[178177]: No server python plugins are available >> seemingly waiting for a connection, but I do not know how > > try calling it with '-h' Ah, duh... thanks... YES, so it run's by default on port localhost:8000 And it is also working (tested) on Windows: Saving a simple project into c:\tmp Starting qgis_mapserver.exe And in browser I go to: http://localhost:8000/?map=c:\tmp\nl.qgs&service=WMS&request=getcapabilities And I have a valid capabilities document! Thanks Ale! Works like a charm ( even on Windooz ;-) ) Is it an idea (feature request?) to let qgis_mapserver.exe spit out an INFO-message line telling the user that "Started a minimal http-server on localhost port 8000 for testing purposes" or so? OR is the code itself not aware it is being ran as a standalone http dev server at that moment? Regards, Richard Duivenvoorde ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On Wed, Apr 15, 2020 at 12:41 PM Richard Duivenvoorde wrote: > > On 4/15/20 11:44 AM, Alessandro Pasotti wrote: > > On Wed, Apr 15, 2020 at 11:39 AM Franko Naimarevic > > >> What am I missing? > > > > The web server component (apache or nginx or any other webserver you > > can plug FCGI into). > > > > FCGI binary is not an HTTP server. > > I think Franko does have a running Apache webserver: in XAMPP the A > stands for Apache? > > > If you have QGIS 3.12 you can try the standalone development server (I > > have not tested it on windows but it may work), the executable name > > should be qgis_mapserver.exe. > > @Allesandro: you say a standalone development server. But (even on > windows) it's not that you run a webserver on port 80 if you run > qgis_mapserver or qgis_mapserver.exe, is it? Yes, it's a full standalone HTTP development server. > If I run it here it's > initing all QGIS machinery and ends with: > INFO Server[178177]: No server python plugins are available > seemingly waiting for a connection, but I do not know how try calling it with '-h' > > To make more clear to Franko: QGIS comes with 2 mapservers: > - a fastcgi module and a (simple) (you need mod_fastcgi (or something > like that for it) > - a cgi module: qgis_mapserver.exe is the simple cgi version. No: that's not correct. qgis_mapserver binary is NOT a CGI module, it is a full HTTP (development) server. It listens on port 8000 by default (it should print it on stdout when it starts). As I said, I didn't test it on windows so I don't even know if that works, work fine on Linux though. > > The last one is easiest, IF the environment of apache is ok, you should > be able to put this in your cgi-bin dir of apache. No! Don't use the development server in production. Is is a very naive 50 lines of code HTTP server implementation. > > To set the right environment, you could have a look into the > osgeo4w64\httpd.d\httpd_qgis.conf (which comes with an osgeo4w64 install > of qgis-server) which has most of the apache-config rules you need: > > DefaultInitEnv O4W_QT_PREFIX "C:\OSGeo4W64/apps/Qt5" > DefaultInitEnv O4W_QT_BINARIES "C:\OSGeo4W64/apps/Qt5/bin" > DefaultInitEnv O4W_QT_PLUGINS "C:\OSGeo4W64/apps/Qt5/plugins" > DefaultInitEnv O4W_QT_LIBRARIES "C:\OSGeo4W64/apps/Qt5/lib" > DefaultInitEnv O4W_QT_TRANSLATIONS "C:\OSGeo4W64/apps/Qt5/translations" > DefaultInitEnv O4W_QT_HEADERS "C:\OSGeo4W64/apps/Qt5/include" > DefaultInitEnv O4W_QT_DOC "C:\OSGeo4W64/apps/Qt5/doc" > > DefaultInitEnv PATH > "C:\OSGeo4W64\apps\qt5\bin;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\grass\@grasspath@\bin;C:\OSGeo4W64\apps\grass\@grasspath@\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\qt5\plugins" > DefaultInitEnv TEMP "C:\Users\richa\AppData\Local\Temp" > DefaultInitEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37" > DefaultInitEnv PYTHONPATH > "C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\Scripts" > > Alias /qgis/ C:\OSGeo4W64/apps/qgis/bin/ > > > SetHandler fcgid-script > Options ExecCGI > # Order/Allow is for Apache 2.2 > #Order allow,deny > #Allow from all > # Require is for Apache 2.4 > Require all granted > > > Off course this should all match your paths, but given this your cgi (or > fastcgi) should be able to find all stuff needed to run qgis-server. > > Easiest way for me was to run an apache with modfcgi in it, install > qgis-server with osgeo4w64 and then just 'include' the httpd_qgis.conf > in your httpd.conf > > Hope this helps, regards, > > Richard Duivenvoorde > > -- Alessandro Pasotti w3: www.itopen.it ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On 4/15/20 11:44 AM, Alessandro Pasotti wrote: > On Wed, Apr 15, 2020 at 11:39 AM Franko Naimarevic >> What am I missing? > > The web server component (apache or nginx or any other webserver you > can plug FCGI into). > > FCGI binary is not an HTTP server. I think Franko does have a running Apache webserver: in XAMPP the A stands for Apache? > If you have QGIS 3.12 you can try the standalone development server (I > have not tested it on windows but it may work), the executable name > should be qgis_mapserver.exe. @Allesandro: you say a standalone development server. But (even on windows) it's not that you run a webserver on port 80 if you run qgis_mapserver or qgis_mapserver.exe, is it? If I run it here it's initing all QGIS machinery and ends with: INFO Server[178177]: No server python plugins are available seemingly waiting for a connection, but I do not know how To make more clear to Franko: QGIS comes with 2 mapservers: - a fastcgi module and a (simple) (you need mod_fastcgi (or something like that for it) - a cgi module: qgis_mapserver.exe is the simple cgi version. The last one is easiest, IF the environment of apache is ok, you should be able to put this in your cgi-bin dir of apache. To set the right environment, you could have a look into the osgeo4w64\httpd.d\httpd_qgis.conf (which comes with an osgeo4w64 install of qgis-server) which has most of the apache-config rules you need: DefaultInitEnv O4W_QT_PREFIX "C:\OSGeo4W64/apps/Qt5" DefaultInitEnv O4W_QT_BINARIES "C:\OSGeo4W64/apps/Qt5/bin" DefaultInitEnv O4W_QT_PLUGINS "C:\OSGeo4W64/apps/Qt5/plugins" DefaultInitEnv O4W_QT_LIBRARIES "C:\OSGeo4W64/apps/Qt5/lib" DefaultInitEnv O4W_QT_TRANSLATIONS "C:\OSGeo4W64/apps/Qt5/translations" DefaultInitEnv O4W_QT_HEADERS "C:\OSGeo4W64/apps/Qt5/include" DefaultInitEnv O4W_QT_DOC "C:\OSGeo4W64/apps/Qt5/doc" DefaultInitEnv PATH "C:\OSGeo4W64\apps\qt5\bin;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\grass\@grasspath@\bin;C:\OSGeo4W64\apps\grass\@grasspath@\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\qt5\plugins" DefaultInitEnv TEMP "C:\Users\richa\AppData\Local\Temp" DefaultInitEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37" DefaultInitEnv PYTHONPATH "C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\Scripts" Alias /qgis/ C:\OSGeo4W64/apps/qgis/bin/ SetHandler fcgid-script Options ExecCGI # Order/Allow is for Apache 2.2 #Order allow,deny #Allow from all # Require is for Apache 2.4 Require all granted Off course this should all match your paths, but given this your cgi (or fastcgi) should be able to find all stuff needed to run qgis-server. Easiest way for me was to run an apache with modfcgi in it, install qgis-server with osgeo4w64 and then just 'include' the httpd_qgis.conf in your httpd.conf Hope this helps, regards, Richard Duivenvoorde ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] QGIS Server installation on Windows via XAMPP
On Wed, Apr 15, 2020 at 11:39 AM Franko Naimarevic wrote: > > Hello, > > I'm trying to setup QGIS Server on my computer (Windows10) to experiment > with how it works. > I managed to get it running locally using XAMPP, following the official > guide > (https://docs.qgis.org/3.10/en/docs/user_manual/working_with_ogc/server/getting_started.html#installation-on-windows). > > I clicked > http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0REQUEST=GetCapabilities > as the guide suggests, and got "Layer(s) not valid", but I figured that > the server was working, since I wasn't getting a "not found" error of > some sorts. > > I then wanted to load my own map, but the guide doesn't really explain > how to do it. After searching around on the internet, I tried: > http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?MAP=/OSGeo4W64/apps/qgis/bin/MAPNAME.qgs > > but got a "Project file error". > > What am I missing? The web server component (apache or nginx or any other webserver you can plug FCGI into). FCGI binary is not an HTTP server. If you have QGIS 3.12 you can try the standalone development server (I have not tested it on windows but it may work), the executable name should be qgis_mapserver.exe. > > > Thanks for your help! > > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user -- Alessandro Pasotti w3: www.itopen.it ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user