[Qgis-user] [QGIS server] python plugins

Alessandro Pasotti apasotti at gmail.com
Tue Mar 3 23:27:17 PST 2015


Hi Bernhard,

I paste here my working virtual server configuration, "xxx" is my user
directory, under which plugins are stored.

If I find the time I will try to install and configure it on a fresh
14.04 VM and report the steps.


cat /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>

   ServerAdmin webmaster at localhost
   DocumentRoot /var/www/html

   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

   # Longer timeout for WPS... default = 40
    FcgidIOTimeout 120
    FcgidInitialEnv LC_ALL "en_US.UTF-8"
    FcgidInitialEnv PYTHONIOENCODING UTF-8
    FcgidInitialEnv LANG "en_US.UTF-8"
    FcgidInitialEnv QGIS_DEBUG 1
    FcgidInitialEnv QGIS_LOG_FILE /tmp/qgis-000.log
    FcgidInitialEnv QGIS_PLUGINPATH "/home/xxx/.qgis2/python/plugins"

    # ABP: needed for QGIS plugins auth
    <IfModule mod_fcgid.c>
        RewriteEngine on
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    </IfModule>

  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin">
    AllowOverride All
    Options +ExecCGI -MultiViews +FollowSymLinks
    Require all granted
  </Directory>

</VirtualHost>



2015-03-04 8:04 GMT+01:00 Bernhard Ströbl <bernhard.stroebl at jena.de>:
> Hi Alessandro,
>
> I created a qgis.log file and changed to QgsLogger.debug() in my plugin.
> "Service Exception", no log messages.
>
> python-qgis is installed (together with all the QGIS desktop dpendencies
> most of which I will not need on a server)
>
> Bernhard
>
> Am 03.03.2015 18:40, schrieb Alessandro Pasotti:
>
>> Hi,
>>
>> a small update: to summon the log file you first need to print
>> something to it (so far so good), but instead of using
>>
>> QgsMessageLog.logMessage( .... )
>>
>> you must use:
>>
>> QgsLogger.debug ( ... )
>>
>>
>> this works for me.
>>
>> Also, check if you have installed python-qgis I see that the package
>> contains the server library too.
>>
>>
>>
>>
>> 2015-03-03 17:39 GMT+01:00 Bernhard Ströbl <bernhard.stroebl at jena.de>:
>>>
>>> Hi Donovan,
>>>
>>> yes it should read "resources", you see in German it is spelled the other
>>> way :-)
>>> no success, though :-(
>>>
>>> Hi Alessandro,
>>>
>>> strange thing there is not even a qgis.log file and there is nothing in
>>> apache's error log.
>>>
>>> Bernhard
>>>
>>> Am 03.03.2015 17:01, schrieb Donovan Cameron:
>>>
>>>> Is there a typo maybe?
>>>>
>>>> FcgidInitialEnv QGIS_CUSTOM_CONFIG_PATH "/usr/share/qgis/ressources/"
>>>>
>>>> So "ressources" should instead be "resources"?
>>>>
>>>>
>>>>
>>>> Donovan
>>>>
>>>> On 03/03/15 08:56 AM, Alessandro Pasotti wrote:
>>>>>
>>>>>
>>>>> Hi Bernhard,
>>>>>
>>>>> anything in the logs?
>>>>>
>>>>> I haven't already tested the 2.8.1, I'm working on a master build and
>>>>> it works fine.
>>>>>
>>>>> I'll test the official packages asap.
>>>>>
>>>>>
>>>>>
>>>>> 2015-03-03 16:53 GMT+01:00 Bernhard Ströbl<bernhard.stroebl at jena.de>:
>>>>>>
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I am trying to make a python plugin run on QGIS server, however all I
>>>>>> get is
>>>>>>
>>>>>> <ServiceException code="Service configuration error">Service unknown
>>>>>> or
>>>>>> unsupported</ServiceException>
>>>>>>
>>>>>> I wonder if qgis server cannot access my plugin or it cannot run my
>>>>>> plugin
>>>>>> because it misses something. My filter has a requestReady hook but
>>>>>> there
>>>>>> is
>>>>>> nothing in the logs. I trieed to configure along [1]:
>>>>>>
>>>>>> This is what I configured:
>>>>>> # QGIS Server python Plugins
>>>>>> FcgidInitialEnv PYTHONIOENCODING UTF-8
>>>>>> FcgidInitialEnv QGIS_DEBUG 1
>>>>>> FcgidInitialEnv QGIS_CUSTOM_CONFIG_PATH "/usr/share/qgis/ressources/"
>>>>>> FcgidInitialEnv QGIS_LOG_FILE ${APACHE_LOG_DIR}/qgis.log
>>>>>> FcgidInitialEnv QGIS_OPTIONS_PATH "/usr/lib/cgi-bin/"
>>>>>> FcgidInitialEnv QGIS_PLUGINPATH "/opt/qgis/python/"
>>>>>> FcgidInitialEnv LD_LIBRARY_PATH "/usr/lib"
>>>>>>
>>>>>> my setting is:
>>>>>> Ubuntu 14.04
>>>>>> qgis-server installed from repo (2.8.1)
>>>>>>
>>>>>> This is a server, so previously no qgis desktop was installed. I now
>>>>>> even
>>>>>> installed this and tried to point the fcgid env variables to the
>>>>>> places
>>>>>> where qgis resides to no avail.
>>>>>>
>>>>>> any help appreciated
>>>>>>
>>>>>> Bernhard
>>>>>>
>>>>>> [1]http://www.itopen.it/qgis-server-python-plugins-tutorial/
>>>>>>
>>>>>>
>>>>>> __________ Information from ESET Mail Security, version of virus
>>>>>> signature
>>>>>> database 11261 (20150303) __________
>>>>>>
>>>>>> The message was checked by ESET Mail Security.
>>>>>> http://www.eset.com
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Qgis-user mailing list
>>>>>> Qgis-user at lists.osgeo.org
>>>>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>>
>>>
>>>
>>> __________ Information from ESET Mail Security, version of virus
>>> signature
>>> database 11262 (20150303) __________
>>>
>>>
>>> The message was checked by ESET Mail Security.
>>> http://www.eset.com
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>>
>
> --
> Bernhard Ströbl
> Anwendungsbetreuer GIS
>
> Kommunale Immobilien Jena
> Am Anger 26
> 07743 Jena
>
> Tel.: 03641 49- 5190
> E-Mail: bernhard.stroebl at jena.de
> Internet: www.kij.de
>
>
> Kommunale Immobilien Jena
> Eigenbetrieb der Stadt Jena
> Werkleiter: Dr. Götz Blankenburg
>
>
> __________ Information from ESET Mail Security, version of virus signature
> database 11265 (20150304) __________
>
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>



-- 
Alessandro Pasotti
w3:   www.itopen.it



More information about the Qgis-user mailing list