Answers.Body: <p>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.</p>
  
  <p>Also two remarks (you probably already know this):</p>
  
  <ul>
  <li>The de.systopia.civiproxy extension is only required if you want to send out mailings; it changes the contained URLs to the proxy</li>
  <li>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.</li>
  </ul>
  
  <p>Cheers
  Björn</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-22T09:25:13.093Z
Answers.Text: 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('https://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
Answers.UserDisplayName: Anna Kiesinger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-22T08:34:19.877Z
Answers.LastActivityDate: 2018-11-22T08:34:19.877Z
Answers.UserDisplayName: Björn Endres
Body: <p>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:</p>
  <p>I've downloaded the latest CiviProxy release (0.6.dev1) following the instructions on <a href="https://docs.civicrm.org/civiproxy/en/latest/installation/#installing-the-proxy-scripts-your-your-civiproxy-server" rel="nofollow noreferrer">https://docs.civicrm.org/civiproxy/en/latest/installation/#installing-the-proxy-scripts-your-your-civiproxy-server</a> and adapted the values for</p>
  <pre><code>$proxy_base     = 'https://civiproxy.mydomain.org';
  $target_civicrm = 'https://www.mycivicrm.de/civicrm';
  </code></pre>
  <p>Basically, my setup seems to work. If I access <a href="https://civiproxy.mydomain.org/index.php" rel="nofollow noreferrer">https://civiproxy.mydomain.org/index.php</a> I can see the CiviProxy page. I also adapted</p>
  <pre><code>// API and SITE keys
  $api_key_map = array('civiproxykey1' =&gt; 'civicrmkey1');
  $sys_key_map = array('civiproxykey2' =&gt; 'civicrmkey2');
  </code></pre>
  <p>and kept the already existing rule</p>
  <pre><code>$rest_allowed_actions = array(
    'all' =&gt; array(
      'Contact' =&gt; array(
        'getsingle' =&gt; array(
          'email' =&gt; 'string',
        ),
      ),
    ),
  );
  </code></pre>
  <p>The target system is running CiviCRM 5.6.0.</p>
  <p>If I run <a href="https://civiproxy.mydomain.org/rest.php?entity=Contact&amp;action=getsingle&amp;key=erikhtestkey&amp;version=3&amp;json=1&amp;api_key=testerikhapikey&amp;email=pipotest@example.org" rel="nofollow noreferrer">https://civiproxy.mydomain.org/rest.php?entity=Contact&amp;action=getsingle&amp;key=erikhtestkey&amp;version=3&amp;json=1&amp;api_key=testerikhapikey&amp;email=pipotest@example.org</a> (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 &quot;invalid key&quot; error if I intentionally use a wrong key.</p>
  <p>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. <code>curl https://www.mycivicrm.de/civicrm</code> 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.</p>
  <p>The de.systopia.civiproxy is installed on the CiviCRM server. I can provide the configuration on that system as well, if needed.</p>
  <p>Kind regards,</p>
  <p>Anna</p>
  
Tags: <error><configuration><500>
Title: Getting Apache 500 error when using CiviProxy
ThreadText: # Getting Apache 500 error when using CiviProxy
  
  (Asked by: username_0 on 2018-11-22)
  
  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=pipotest@example.org (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
  
  **Tags:** error, configuration, 500
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-11-22. Score: 0 | Accepted answer
  
  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
  
  > **Comments:**
  > **username_0**: 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('https://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  
  
  ---
  
  