title: Zend / Apache2: Getting 302 Found when requesting url several times
body: <p>I am programming a <strong>REST API</strong> with <strong>Zend framework</strong>.<br>
  When calling the url several times (e.g. 1000 times with 1 request per second), in about <strong>0.2 %</strong> of the cases instead of getting <strong><code>200 OK</code></strong> as a response I get <strong><code>302 Found</code></strong> - so a redirect to a different page.<br>
  Here is the entire server response:</p>
  
  <pre><code>302 Found Date: Mon, 04 Mar 2013 11:56:04 GMT
  Server: Apache/2.2.17 (Ubuntu)
  X-Powered-By: PHP/5.3.5-1ubuntu7.11
  Set-Cookie: PHPSESSID=ui9r8jqa63dbom8osknso6eea5; path=/
  Expires: Thu, 19 Nov 1981 08:52:00 GMT
  Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  Pragma: no-cache
  Location: /de/default/index/index/error/500
  Vary: Accept-Encoding
  Content-Length: 0
  Content-Type: text/html; charset=utf-8
  </code></pre>
  
  <p>So Zend redirects to the <strong>error 500</strong> (internal server error) page. The question is <strong>why</strong> - and I just can't figure it out...<br>
  The php page that is called inserts <strong>one row into a MySQL database</strong> and returns a JSON string - that's all.</p>
  
  <p><strong>Apache2</strong> has about <strong>20 concurrent connections</strong> open and the server load is &lt;&lt;1 so I really do not understand why the requests cause problems.</p>
  
  <p><strong>I know this is a really difficult problem to remote diagnose, but good guesses and recommendations how to solve this are more than welcome! Thanks.</strong></p>
  
  <p>This is the apache vhost config as requested by @chris:</p>
  
  <pre><code>&lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost mydomain.tld:443&gt;
      ServerAdmin webmaster@localhost
  
      DocumentRoot /var/www
      ServerName www.mydomain.tld
      ServerAlias mydomain.tld *.mydomain.tld
      &lt;Directory /&gt;
          Options FollowSymLinks
          AllowOverride All
      &lt;/Directory&gt;
      &lt;Directory /var/www/&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          Order allow,deny
          allow from all
      &lt;/Directory&gt;
  
      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      &lt;Directory "/usr/lib/cgi-bin"&gt;
          AllowOverride None
          Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/error.log
  
      # Possible values include: debug, info, notice, warn, error, crit,
      # alert, emerg.
      LogLevel warn
  
      CustomLog /var/log/apache2/ssl_access.log combined
  
  #   RewriteLog "/var/log/htaccess.log"
  #   RewriteLogLevel 5
  
      Alias /doc/ "/usr/share/doc/"
      &lt;Directory "/usr/share/doc/"&gt;
          Options Indexes MultiViews FollowSymLinks
          AllowOverride None
          Order deny,allow
          Deny from all
          Allow from 127.0.0.0/255.0.0.0 ::1/128
      &lt;/Directory&gt;
  
      #   SSL Engine Switch:
      #   Enable/Disable SSL for this virtual host.
      SSLEngine on
      SSLOptions +StrictRequire
      SSLCertificateFile /etc/apache2/ssl/cert_2013_2014.crt
      SSLCertificateKeyFile /etc/apache2/ssl/www.mydomain.tld.key
      SSLCACertificateFile /etc/apache2/ssl/intermediate.crt
  
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>