QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

andrew terry

Hi,

 

I’m finding with QGIS 3.0.3 and NGINX using FastCGI, running on Ubuntu Bionic that calls to a project appear to start a fresh session for every WMS request.

 

In the qgis logs I’m seeing the loading of the file and session started before each WMS request log. In the nginx error logs I’m seeing in particular:

 

“2018/06/12 09:05:06 [error] 1301#1301: *9 FastCGI sent in stderr: "QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-www-data'”

 

I’m then seeing a new QGIS file and a session folder appear within /tmp/ for every WMS request posted.

 

I’ve successfully run QGIS 2.18 previously with NGINX and have tried to ensure not settings differ. I also tried Apache (on Debian Stretch) successfully with 3.0.3

 

I am only using the QGIS tutorial content for testing. The WMS output is being served successfully.

 

Any advice gratefully received.

 

Andy

 

 


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

Alessandro Pasotti-2
Hi,


regarding QStandardPaths: XDG_RUNTIME_DIR not set: are you running an xvfb instance?




On Thu, Jun 14, 2018 at 1:18 PM, Andrew Terry <[hidden email]> wrote:

Hi,

 

I’m finding with QGIS 3.0.3 and NGINX using FastCGI, running on Ubuntu Bionic that calls to a project appear to start a fresh session for every WMS request.

 

In the qgis logs I’m seeing the loading of the file and session started before each WMS request log. In the nginx error logs I’m seeing in particular:

 

“2018/06/12 09:05:06 [error] 1301#1301: *9 FastCGI sent in stderr: "QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-www-data'”

 

I’m then seeing a new QGIS file and a session folder appear within /tmp/ for every WMS request posted.

 

I’ve successfully run QGIS 2.18 previously with NGINX and have tried to ensure not settings differ. I also tried Apache (on Debian Stretch) successfully with 3.0.3

 

I am only using the QGIS tutorial content for testing. The WMS output is being served successfully.

 

Any advice gratefully received.

 

Andy

 

 


_______________________________________________
Qgis-user mailing list
[hidden email]
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
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

andrew terry
Hi Alessandro,

Thanks for the thought, i did include the xvfb install and config. Always
double check though and the status report is as follows - only just showing
as started as i booted the instance to check:

● xvfb.service - X Virtual Frame Buffer Service
   Loaded: loaded (/etc/systemd/system/xvfb.service; enabled; vendor preset:
enabled)
   Active: active (running) since Thu 2018-06-14 13:23:50 UTC; 37s ago
 Main PID: 840 (Xvfb)
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/xvfb.service
           └─840 /usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX
+render -noreset

Jun 14 13:23:50 ip-172-31-14-242 systemd[1]: Started X Virtual Frame Buffer
Service.

Thanks Andy



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

Alessandro Pasotti-2
Looks good.

I don't know where else to look but if you want a tested working configuration you can have a look to: https://github.com/elpaso/qgis3-server-vagrant

On Thu, Jun 14, 2018 at 3:34 PM, andrew terry <[hidden email]> wrote:
Hi Alessandro,

Thanks for the thought, i did include the xvfb install and config. Always
double check though and the status report is as follows - only just showing
as started as i booted the instance to check:

● xvfb.service - X Virtual Frame Buffer Service
   Loaded: loaded (/etc/systemd/system/xvfb.service; enabled; vendor preset:
enabled)
   Active: active (running) since Thu 2018-06-14 13:23:50 UTC; 37s ago
 Main PID: 840 (Xvfb)
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/xvfb.service
           └─840 /usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX
+render -noreset

Jun 14 13:23:50 ip-172-31-14-242 systemd[1]: Started X Virtual Frame Buffer
Service.

Thanks Andy



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
_______________________________________________
Qgis-user mailing list
[hidden email]
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
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

andrew terry
Excellent - i have been looking at a couple of docker examples but i'll
definitely delve into yours including the various options e.g.
fastcgi/python. Thank you again so far


Alessandro Pasotti-2 wrote
> Looks good.
>
> I don't know where else to look but if you want a tested working
> configuration you can have a look to:
> https://github.com/elpaso/qgis3-server-vagrant
>
> On Thu, Jun 14, 2018 at 3:34 PM, andrew terry &lt;

> andrew.terry@.co

> &gt; wrote:
>
>> Hi Alessandro,
>>
>> Thanks for the thought, i did include the xvfb install and config. Always
>> double check though and the status report is as follows - only just
>> showing
>> as started as i booted the instance to check:
>>
>> ● xvfb.service - X Virtual Frame Buffer Service
>>    Loaded: loaded (/etc/systemd/system/xvfb.service; enabled; vendor
>> preset:
>> enabled)
>>    Active: active (running) since Thu 2018-06-14 13:23:50 UTC; 37s ago
>>  Main PID: 840 (Xvfb)
>>     Tasks: 3 (limit: 4915)
>>    CGroup: /system.slice/xvfb.service
>>            └─840 /usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension
>> GLX
>> +render -noreset
>>
>> Jun 14 13:23:50 ip-172-31-14-242 systemd[1]: Started X Virtual Frame
>> Buffer
>> Service.
>>
>> Thanks Andy
>>
>>
>>
>> --
>> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> _______________________________________________
>> Qgis-user mailing list
>>

> Qgis-user@.osgeo

>> 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@.osgeo

> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user





--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

Alessandro Pasotti-2

On Thu, Jun 14, 2018 at 3:46 PM, andrew terry <[hidden email]> wrote:
Excellent - i have been looking at a couple of docker examples but i'll
definitely delve into yours including the various options e.g.
fastcgi/python. Thank you again so far




np, but please keep in mind that my vagrant was prepared for a training course and it wasn't security audited!

the goal was to explore all different possibilities to deploy QGIS server (with some focus to Python).



Alessandro Pasotti-2 wrote
> Looks good.
>
> I don't know where else to look but if you want a tested working
> configuration you can have a look to:
> https://github.com/elpaso/qgis3-server-vagrant
>
> On Thu, Jun 14, 2018 at 3:34 PM, andrew terry &lt;

> andrew.terry@.co

> &gt; wrote:
>
>> Hi Alessandro,
>>
>> Thanks for the thought, i did include the xvfb install and config. Always
>> double check though and the status report is as follows - only just
>> showing
>> as started as i booted the instance to check:
>>
>> ● xvfb.service - X Virtual Frame Buffer Service
>>    Loaded: loaded (/etc/systemd/system/xvfb.service; enabled; vendor
>> preset:
>> enabled)
>>    Active: active (running) since Thu 2018-06-14 13:23:50 UTC; 37s ago
>>  Main PID: 840 (Xvfb)
>>     Tasks: 3 (limit: 4915)
>>    CGroup: /system.slice/xvfb.service
>>            └─840 /usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension
>> GLX
>> +render -noreset
>>
>> Jun 14 13:23:50 ip-172-31-14-242 systemd[1]: Started X Virtual Frame
>> Buffer
>> Service.
>>
>> Thanks Andy
>>
>>
>>
>> --
>> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> _______________________________________________
>> Qgis-user mailing list
>>

> Qgis-user@.osgeo

>> 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@.osgeo



--
Alessandro Pasotti
w3:   www.itopen.it

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

andrew terry
Of course. This is only some closed testing. One element i did note from your
code and some of the docker examples on github was seemingly explicitly
setting the sockets/processes. I didn't have a problem not doing this with
2.18 and haven't seen it in the documentation generally, do i need to extend
my linux knowledge?:

# Configure FastCGI nginx conf
sed -i -e "s@QGIS_SERVER_DIR@${QGIS_SERVER_DIR}@g"
/etc/nginx/sites-enabled/qgis-server-fcgi
SOCKETS=''
for i in $( eval echo {1..$NUM_PROCESSES}); do SOCKETS="    server
unix:/run/qgis_mapserv$i.sock;\n$SOCKETS" ; done
sed -i -e "s@QGIS_SERVER_SOCKETS@${SOCKETS}@g"
/etc/nginx/sites-enabled/qgis-server-fcgi


Alessandro Pasotti-2 wrote
> On Thu, Jun 14, 2018 at 3:46 PM, andrew terry &lt;

> andrew.terry@.co

> &gt; wrote:
>
>>
>
> np, but please keep in mind that my vagrant was prepared for a training
> course and it wasn't security audited!
>
> the goal was to explore all different possibilities to deploy QGIS server
> (with some focus to Python).
>
>
>
> Alessandro Pasotti-2 wrote
>> > Looks good.
>> >
>> > I don't know where else to look but if you want a tested working
>> > configuration you can have a look to:
>> > https://github.com/elpaso/qgis3-server-vagrant
>> >
>> > On Thu, Jun 14, 2018 at 3:34 PM, andrew terry &lt;
>>
>> > andrew.terry@.co
>>
>> > &gt; wrote:
>> >
>> >> Hi Alessandro,
>> >>
>> >> Thanks for the thought, i did include the xvfb install and config.
>> Always
>> >> double check though and the status report is as follows - only just
>> >> showing
>> >> as started as i booted the instance to check:
>> >>
>> >> ● xvfb.service - X Virtual Frame Buffer Service
>> >>    Loaded: loaded (/etc/systemd/system/xvfb.service; enabled; vendor
>> >> preset:
>> >> enabled)
>> >>    Active: active (running) since Thu 2018-06-14 13:23:50 UTC; 37s ago
>> >>  Main PID: 840 (Xvfb)
>> >>     Tasks: 3 (limit: 4915)
>> >>    CGroup: /system.slice/xvfb.service
>> >>            └─840 /usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac
>> +extension
>> >> GLX
>> >> +render -noreset
>> >>
>> >> Jun 14 13:23:50 ip-172-31-14-242 systemd[1]: Started X Virtual Frame
>> >> Buffer
>> >> Service.
>> >>
>> >> Thanks Andy
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> >> _______________________________________________
>> >> Qgis-user mailing list
>> >>
>>
>> > Qgis-user@.osgeo
>>
>> >> 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@.osgeo
>>
>> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>>
>>
>> --
>> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> _______________________________________________
>> Qgis-user mailing list
>>

> Qgis-user@.osgeo

>> 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@.osgeo

> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user





--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

Alessandro Pasotti-2
On Thu, Jun 14, 2018 at 4:08 PM, andrew terry <[hidden email]> wrote:
Of course. This is only some closed testing. One element i did note from your
code and some of the docker examples on github was seemingly explicitly
setting the sockets/processes. I didn't have a problem not doing this with
2.18 and haven't seen it in the documentation generally, do i need to extend
my linux knowledge?:

# Configure FastCGI nginx conf
sed -i -e "s@QGIS_SERVER_DIR@${QGIS_SERVER_DIR}@g"
/etc/nginx/sites-enabled/qgis-server-fcgi
SOCKETS=''
for i in $( eval echo {1..$NUM_PROCESSES}); do SOCKETS="    server
unix:/run/qgis_mapserv$i.sock;\n$SOCKETS" ; done
sed -i -e "s@QGIS_SERVER_SOCKETS@${SOCKETS}@g"
/etc/nginx/sites-enabled/qgis-server-fcgi


No: that is not necessary, I just did it in order to have some basic load balancing.

You can have a single server instance listening on a single socket.

 

Alessandro Pasotti-2 wrote
> On Thu, Jun 14, 2018 at 3:46 PM, andrew terry &lt;

> andrew.terry@.co

> &gt; wrote:
>
>>
>
> np, but please keep in mind that my vagrant was prepared for a training
> course and it wasn't security audited!
>
> the goal was to explore all different possibilities to deploy QGIS server
> (with some focus to Python).
>
>
>
> Alessandro Pasotti-2 wrote
>> > Looks good.
>> >
>> > I don't know where else to look but if you want a tested working
>> > configuration you can have a look to:
>> > https://github.com/elpaso/qgis3-server-vagrant
>> >
>> > On Thu, Jun 14, 2018 at 3:34 PM, andrew terry &lt;
>>
>> > andrew.terry@.co
>>
>> > &gt; wrote:
>> >
>> >> Hi Alessandro,
>> >>
>> >> Thanks for the thought, i did include the xvfb install and config.
>> Always
>> >> double check though and the status report is as follows - only just
>> >> showing
>> >> as started as i booted the instance to check:
>> >>
>> >> ● xvfb.service - X Virtual Frame Buffer Service
>> >>    Loaded: loaded (/etc/systemd/system/xvfb.service; enabled; vendor
>> >> preset:
>> >> enabled)
>> >>    Active: active (running) since Thu 2018-06-14 13:23:50 UTC; 37s ago
>> >>  Main PID: 840 (Xvfb)
>> >>     Tasks: 3 (limit: 4915)
>> >>    CGroup: /system.slice/xvfb.service
>> >>            └─840 /usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac
>> +extension
>> >> GLX
>> >> +render -noreset
>> >>
>> >> Jun 14 13:23:50 ip-172-31-14-242 systemd[1]: Started X Virtual Frame
>> >> Buffer
>> >> Service.
>> >>
>> >> Thanks Andy
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> >> _______________________________________________
>> >> Qgis-user mailing list
>> >>
>>
>> > Qgis-user@.osgeo
>>
>> >> 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@.osgeo
>>
>> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>>
>>
>> --
>> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> _______________________________________________
>> Qgis-user mailing list
>>

> Qgis-user@.osgeo

>> 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@.osgeo

> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user





--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
_______________________________________________
Qgis-user mailing list
[hidden email]
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
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

andrew terry
I enjoyed the related presentation - http://www.itopen.it/bulk/qgis3-server
any personal preference between NGINX with Python / FastCGI ?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Server 3.0.3 with NGINX / FastCGI - Sessions not persisting?

Alessandro Pasotti-2
On Thu, Jun 14, 2018 at 5:59 PM, andrew terry <[hidden email]> wrote:
I enjoyed the related presentation - http://www.itopen.it/bulk/qgis3-server
any personal preference between NGINX with Python / FastCGI ?



My preferred choice would be nginx but don't expect big differences between the various deployment methods, Python is a bit experimental but looks promising.


--
Alessandro Pasotti
w3:   www.itopen.it

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user