0

Because I haven't seen this topic here, I assume I'm handling a rather basic configuration error, but I've been stuck for three days now:

I've downloaded the latest CiviProxy release (0.6.dev1) following the instructions on https://docs.civicrm.org/civiproxy/en/latest/installation/#installing-the-proxy-scripts-your-your-civiproxy-server and adapted the values for

$proxy_base     = 'https://civiproxy.mydomain.org';
$target_civicrm = 'https://www.mycivicrm.de/civicrm';

Basically, my setup seems to work. If I access https://civiproxy.mydomain.org/index.php I can see the CiviProxy page. I also adapted

// API and SITE keys
$api_key_map = array('civiproxykey1' => 'civicrmkey1');
$sys_key_map = array('civiproxykey2' => 'civicrmkey2');

and kept the already existing rule

$rest_allowed_actions = array(
  'all' => array(
    'Contact' => array(
      'getsingle' => array(
        'email' => 'string',
      ),
    ),
  ),
);

The target system is running CiviCRM 5.6.0.

If I run https://civiproxy.mydomain.org/rest.php?entity=Contact&action=getsingle&key=erikhtestkey&version=3&json=1&api_key=testerikhapikey&[email protected] (with adapted key values of course), I get an Apache 500 error. Accessing CiviCRM directly (with adapted keys) returns some data, so it looks to me like every component is doing fine but the connection is not working. My basic key usage seems to be OK. At least I get an "invalid key" error if I intentionally use a wrong key.

In order to see whether CiviProxy is trying to contact CiviCRM in the first place, I ran tcpdump on the CiviProxy server and saw no data going out to CiviCRM. curl https://www.mycivicrm.de/civicrm is doing well, so my current assumption is that for some mistake I made in the CiviProxy setup, it is not even trying to connect to CiviCRM. I also tried installing CiviProxy on the CiviCRM server, but didn't succeed either.

The de.systopia.civiproxy is installed on the CiviCRM server. I can provide the configuration on that system as well, if needed.

Kind regards,

Anna

1 Answer 1

0

The key to this would be the actual error message. HTTP Error 500 usually means that PHP encountered a fatal error, which should end up in the webserver's error log. Could you have a look? It could be in /var/log/apache2/error.log, but it depends on your configuration.

Also two remarks (you probably already know this):

  • The de.systopia.civiproxy extension is only required if you want to send out mailings; it changes the contained URLs to the proxy
  • Installing the proxy scripts on the same environment is not what we had in mind, the ideal place would be a separate environment in the DMZ.

Cheers Björn

1
  • Kudos, and shame on me for not having looked into the logs. They say: [Thu Nov 22 09:18:11.337745 2018] [php7:error] [pid 35454] [client 1.2.3.4:46204] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/html/proxy.php:25\nStack trace:\n#0 /var/www/html/rest.php(91): civiproxy_redirect('www....', Array)\n#1 {main}\n thrown in /var/www/html/proxy.php on line 25 After apt install php-curl systemctl restart apache2 the connection working. Thanks a lot for your quick help, Anna Commented Nov 22, 2018 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.