<div dir="ltr"><div><div><div><div><div><div>I report my progress here<br><br></div>I managed to get a PDF via the GetPrint request by following these steps<br><br></div>1/ Create a fake X server<br>Xvfb :99 -ac -noreset &<br>
<br></div>2/ Add the option in the fastcgi , for example<br>  FastCgiConfig -idle-timeout 70 -maxClassProcesses 50 -minProcesses 3 -init-start-delay 3 -restart-delay 20 -startDelay 15 -initial-env DISPLAY=:99  LD_LIBRARY_PATH=/home/kimaidou/src/qgis/build/lib/<br>
<br></div>3/ Restart Apache<br></div>service apache2 restart<br><br><br></div><div>After this, I tried the GetPrint request from my QGIS project with a composer containing a HTML item. The request get a PDF as an answer, but the HTML item is empty.<br>
<br></div><div>I will try with another composer, etc., and report here.<br><br></div><div>By the way, is there a way to pass an HTML string via a parameter to the getPrint request for HTML items, as it is possible for text item ? This would rock !<br>
<br>Michael<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/23 kimaidou <span dir="ltr"><<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi Tim and Marco<br><br></div>I come back to this subject after helping to solve the performance problem with Mathias.<br></div>So, I am first runnning my tests on my ubuntu laptop. Since it is my computer, it is not ubuntu server but the classical Ubuntu with an X server running.<br>

<br></div>I tried in my terminal<br></div>echo $DISPLAY<br>:0<br><br></div>So it seems (but I am far from being a X server guru !) that this is the DISPLAY value I should pass to QGIS Server.<br></div>This is why I added the following configurartion in my virtual host (and in the fastcgi config file):<br>

<br></div>In the virtual host<br>        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<br>        <Directory "/usr/lib/cgi-bin"><br>                AllowOverride None<br>                Options +ExecCGI -MultiViews FollowSymLinks<br>

                Order allow,deny<br>                Allow from all<br>                SetEnv LD_LIBRARY_PATH "/home/kimaidou/src/qgis/build/lib"<br>                SetEnv DISPLAY :0<br>        </Directory><br>

<br><br></div>In /etc/apache2/mods-available/fastcgi.conf<br><br><IfModule mod_fastcgi.c><br>  AddHandler fastcgi-script .fcgi<br>  #FastCgiWrapper /usr/lib/apache2/suexec<br>  FastCgiIpcDir /var/lib/apache2/fastcgi<br>

  FastCgiConfig -idle-timeout 70 -maxClassProcesses 50 -minProcesses 3 -init-start-delay 3 -restart-delay 20 -startDelay 15 -initial-env DISPLAY=:0 -initial-env LD_LIBRARY_PATH=/home/kimaidou/src/qgis/build/lib/<br></IfModule><br>

<br></div><div>I am pretty confident the default configuration is not used but I doubled it just in case<br></div><div><br></div>After restarting my Apache Server, QGIS Server just hangs with the very simple URL<br><a href="http://localhost/cgi-bin/qgis_mapserv.fcgi" target="_blank">http://localhost/cgi-bin/qgis_mapserv.fcgi</a><br>

</div>which should reply with an error in XML format.<br></div><div>So it seems Apache/QGIServer do not like my DISPLAY parameter.<br></div><div><br></div>Any hint ?<br></div>Would it be simplier to test this in a real server with no existing X Server by using Xfvb ?<br>

<br></div>Michael<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/22 Tim Sutton <span dir="ltr"><<a href="mailto:lists@linfiniti.com" target="_blank">lists@linfiniti.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
You might also want to consider using Xfvb as a 'fake' xserver.<br>
<br>
Regards<br>
<br>
Tim<br>
<div><div><br>
On Wed, May 22, 2013 at 10:19 AM, kimaidou <<a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</a>> wrote:<br>
> Thanks for your answer Marco. I will try to use the workaround you described<br>
> and report progress here.<br>
><br>
> Michael<br>
><br>
><br>
> 2013/5/22 Marco Hugentobler <<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a>><br>
>><br>
>> Hi Michael<br>
>><br>
>> I also encountered that problem. Unfortunately, it seems that QWebKit<br>
>> requires a running x-server. So it won't be possible to use html items in<br>
>> server projects (or you can run an x-server and set the DISPLAY variable in<br>
>> the fcgi conf).<br>
>><br>
>> Regards,<br>
>> Marco<br>
>><br>
>> On 22.05.2013 09:43, kimaidou wrote:<br>
>><br>
>> Hi list<br>
>><br>
>> I have tried it with today's qgis master.<br>
>><br>
>> I have a very simple project with one shapefile containing 3 polygones. I<br>
>> created a composer with a map. GetPrint request works fine with it. If I add<br>
>> an HTML block in the composer (refering to one HTML file or not), the<br>
>> getPrint request raises a segfault.<br>
>><br>
>> Apache error log is the well-known :<br>
>> "Premature end of script headers: qgis_mapserv2.fcgi"<br>
>><br>
>> By the way, I compiled QGIS with -DCMAKE_BUILD_TYPE=debug , but I do not<br>
>> know where I can find complet log for QGIS Server. Is there a file where I<br>
>> can get complete log for QGIS Server ?<br>
>><br>
>> I can provide a sample project if needed. I have not found a ticket in the<br>
>> hub, so I will fill one, but I would prefer to do so with a self-explaining<br>
>> log.<br>
>><br>
>> Michael<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> Dr. Marco Hugentobler<br>
>> Sourcepole -  Linux & Open Source Solutions<br>
>> Weberstrasse 5, CH-8004 Zürich, Switzerland<br>
>> <a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a> <a href="http://www.sourcepole.ch" target="_blank">http://www.sourcepole.ch</a><br>
>> Technical Advisor QGIS Project Steering Committee<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
<br>
<br>
<br>
--<br>
</div></div>Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)<br>
==============================================<br>
Please do not email me off-list with technical<br>
support questions. Using the lists will gain<br>
more exposure for your issues and the knowledge<br>
surrounding your issue will be shared with all.<br>
<br>
Visit <a href="http://linfiniti.com" target="_blank">http://linfiniti.com</a> to find out about:<br>
 * QGIS programming and support services<br>
 * Mapserver and PostGIS based hosting plans<br>
 * FOSS Consulting Services<br>
Skype: timlinux<br>
Irc: timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a><br>
==============================================<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>