Koozali.org: home of the SME Server

Problem getting Limesurvey to work

Offline holck

  • ****
  • 317
  • +1/-0
Problem getting Limesurvey to work
« on: January 04, 2017, 09:49:09 AM »
Reporting the problem here, as Limesurvery is not part of smecontribs... I have tried to install Limesurvey, following the description at http://wiki.contribs.org/Limesurvey, but it is not without problems.

First, I had to change the contents of the file /etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey. The lines
Code: [Select]
if ($alias ne ''){
    $OUT .=<<'END';
<LocationMatch "^/limesurvey/(index\.php/)?admin">
    SSLRequireSSL on
    $auth
</LocationMatch>
END
should be changed to
Code: [Select]
if ($alias ne ''){
    $OUT .=<<"END";
<LocationMatch "^/limesurvey/(index\.php/)?admin">
    SSLRequireSSL on
    $auth
</LocationMatch>
END
To make the template expansion use the contents of the $auth-variable.

But now, if I try to go to https://192.168.10.1/limesurvey or https://192.168.10.1/limesurvey/admin (using the server's local IP address), I just get a page with the text
Code: [Select]
The 192.168.10.1 page isn’t working

192.168.10.1 is currently unable to handle this request.
HTTP ERROR 500
Neither /var/log/php.log nor /var/log/httpd/error.log shows error messages, providing a clue to what went wrong.

Maybe someone here can help?

Jesper H, Denmark
......

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problem getting Limesurvey to work
« Reply #1 on: January 04, 2017, 09:05:22 PM »
I used it for a while but by installing it in an ibay.

indeed what you pont is a difference between the directive for SME8 and SME9.
can you confirm you installed the right version?

are you able to access to other http address on the server after the installation ?

maybe Daniel could give some input as he is the one maintaining this contrib!

Offline holck

  • ****
  • 317
  • +1/-0
Re: Problem getting Limesurvey to work
« Reply #2 on: January 04, 2017, 09:31:31 PM »
I managed to get Limesurvey to work :-) I enabled debug-mode in Limesurvey, and then /var/log/httpd/error_log showed
Code: [Select]
[Wed Jan 04 14:12:50 2017] [error] [client 192.168.10.227] PHP Fatal error:  Cannot redeclare hook_get_auth_webserver_profile() (previously declared in /usr/share/limesurvey/application/config/config.php:56) in /usr/share/limesurvey/application/config/config.php on line 80
The relevant part of /usr/share/limesurvey/application/config/config.php comes from /etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/25ProfileHook - containing these lines
Code: [Select]
function hook_get_auth_webserver_profile(\$user_name) {
   if (!isset(\$_SERVER['REMOTE_USER'])){
       return false;
   }
     ...
}
I now changed this to
Code: [Select]
if (!function_exists('hook_get_auth_webserver_profile')) {
  function hook_get_auth_webserver_profile(\$user_name) {
      if (!isset(\$_SERVER['REMOTE_USER'])){
          return false;
      }
  ...
  }
}
In this way, the function "hook_get_auth_webserver_profile" is only declared once. And now everything seems to run smoothly...

Jesper H, Denmark
« Last Edit: January 05, 2017, 08:26:51 AM by holck »
......

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problem getting Limesurvey to work
« Reply #3 on: January 05, 2017, 01:54:34 AM »
Jesper,

thank you for the debugging, it seems that there is some needs to update the contrib !

Offline holck

  • ****
  • 317
  • +1/-0
Re: Problem getting Limesurvey to work
« Reply #4 on: January 07, 2017, 09:31:47 PM »
I had one problem more after the installation: there was no superadmin-user. Neither user "admin" nor my own account had superadmin-privileges. So nobody could give users new rights, do template administration, set general options etc. I found a workaround for this, using MySQL:
Code: [Select]
$ mysql
mysql> use limesurvey;
mysql> insert into permissions (entity, entity_id, uid, permission, read_p) values ('global', 0, 1, 'superadmin', 1);
mysql> quit;
In this example, I update the permissions for the user with uid = 1 to include the superadmin-permission.
I hope in some way, I can help to improve the contrib - Limesurvey is a very valuable tool.

/Jesper H, Denmark
......