I am programming a REST API with a Zend framework .
When I call the URL several times (for example, 1000 times with 1 request per second) in about 0.2% of cases, instead of receiving 200 OK as an answer, I get 302 Found - so it redirects to another page.
Here is the whole server response:
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
So, Zend redirects the page error 500 (internal server error). The question is why - and I just can't figure it out ...
A php page called inserting a single row into a MySQL database and returns a JSON string is all.
Apache2 has about 20 concurrent connections , and the server load is <1, so I really don't understand why requests cause problems.
I know that this is a very difficult problem for remote diagnostics, but good guesses and recommendations on how to solve this problem are more than welcome! Thanks.
This is the vache Apache configuration as requested by @chris:
<IfModule mod_ssl.c> <VirtualHost mydomain.tld:443> ServerAdmin webmaster@localhost DocumentRoot /var/www ServerName www.mydomain.tld ServerAlias mydomain.tld *.mydomain.tld <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> 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/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> # 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 </VirtualHost> </IfModule>
api php mysql apache2 zend-framework
Horen
source share