How to debug solve 500 Internal error aws micro ec2 with suexec, Apache and php CGi

7,212

I Upgraded from a Miro instance to a Small instance which seems to have solved the problem no more 500 errors.

It appears that the Miro instance doesn't have enough memory to effectively operate WordPress Multi-Site on a consistent bases.

Share:
7,212

Related videos on Youtube

Oudin
Author by

Oudin

Updated on September 18, 2022

Comments

  • Oudin
    Oudin over 1 year

    I'm running WordPress multi-site on an amazon micro ec2 with suexec, Apache and php CGi On Ubuntu 12.04 However I've been experiencing a lot of Internal server 500 errors and I'm in the process of debugging it to find a solution. I've posted my error logs below

    example.com error.log:

    [Fri Oct 26 10:10:08 2012] [warn] [client 23.23.xxx.xx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
    [Fri Oct 26 10:10:08 2012] [error] [client 23.23.xxx.xx] Premature end of script headers: wp-cron.php
    [Fri Oct 26 10:50:04 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/
    [Fri Oct 26 10:50:04 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: admin.php, referer: https://www.example.com/wp-admin/
    [Fri Oct 26 10:58:14 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/network/index.php
    [Fri Oct 26 10:58:15 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: admin-ajax.php, referer: https://www.example.com/wp-admin/network/index.php
    [Fri Oct 26 10:58:56 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/network/index.php
    [Fri Oct 26 10:58:57 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: plugins.php, referer: https://www.example.com/wp-admin/network/index.php
    [Fri Oct 26 10:59:18 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/network/index.php
    [Fri Oct 26 10:59:18 2012] [error] [client 190.213.xxx.xxx] Premature end of script headers: admin-ajax.php, referer: https://www.example.com/wp-admin/network/index.php
    [Fri Oct 26 11:01:49 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: https://www.example.com/wp-admin/
    [Fri Oct 26 11:01:49 2012] [warn] [client 190.213.xxx.xxx] (104)Connection reset by peer: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: https://www.example.com/wp-admin/
    

    Apache Log:

    php (pre-forking): Cannot allocate memory
    php (pre-forking): Cannot allocate memory
    Recipient names must be specified
    Recipient names must be specified
    php (pre-forking): Cannot allocate memory
    php (pre-forking): Cannot allocate memory
    php (pre-forking): Cannot allocate memory
    [Fri Oct 26 10:49:33 2012] [warn] mod_fcgid: cleanup zombie process 2852
    [Fri Oct 26 10:49:33 2012] [warn] mod_fcgid: cleanup zombie process 2851
    [Fri Oct 26 10:49:33 2012] [warn] mod_fcgid: cleanup zombie process 2853
    [Fri Oct 26 10:58:22 2012] [warn] mod_fcgid: process 2892 graceful kill fail, sending SIGKILL
    php (pre-forking): Cannot allocate memory
    [Fri Oct 26 10:59:21 2012] [warn] mod_fcgid: process 2894 graceful kill fail, sending SIGKILL
    [Fri Oct 26 10:59:25 2012] [warn] mod_fcgid: process 2866 graceful kill fail, sending SIGKILL
    

    suexec.log:

    [2012-10-25 16:05:36]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 18:09:38]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 18:09:51]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 18:14:03]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 18:14:06]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 18:14:35]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 20:20:27]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 20:20:29]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 20:20:31]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 21:42:12]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-25 22:56:50]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 02:34:43]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 04:25:07]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 06:35:19]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 06:40:05]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 07:22:45]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 10:10:05]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 10:49:24]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    [2012-10-26 10:49:24]: uid: (1002/username) gid: (1002/username) cmd: php-fcgi
    

    based on the logs can any determine what might be the cause of this? Thinking that it might be the micro instance I'm thinking of upgrading to a small.

    Any help would be greatly appreciated.

    This is the output after typing free -m

                 total       used       free     shared    buffers     cached
    Mem:           590        583          6          0          2         22
    -/+ buffers/cache:        559         30
    Swap:            0          0          0
    
    • bmurtagh
      bmurtagh over 11 years
      What does your memory situation look like? Type: 'free -m' from the shell and post the output.
  • Oudin
    Oudin over 11 years
    I would love to switch too nginx+php-fpm. based on reading about it I know it is very light weight but I'm more comfortable with Apache since I've been using it for years. The memory limit is set to 128 I also have an intranet,crm and billing application set up on the server with 128 memory limit each would these apps also be a cause of the error