WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 500 Internal Server Error (12 posts)

  1. michaeljdornan
    Member
    Posted 1 year ago #

    Hi All, I have recently setup a monster of a system, Multisite with Buddypress:

    WP - Lastest Version
    WP Multi Site Enabled
    Buddypress Multiblog Enabled
    BuddyPress Installed and Multi Network

    Setup is

    Site1 - BuddyPress
    Site1.subsite1 - BuddyPress (x 20 Subsites)

    So all in all i have 21 buddypress sites, but only one main site.

    I've been struggling with the old 500 Internal Server Error (see below), I know it's very generic, strange thing is, it only happens when I open a lot of windows, so if I click to open all the dashboards or all thes sites in multiple tabs more than half will get the 500 Server Error, so my concern is when this site launches (in 3 - 4 days) and my clients redirects all his traffic, things are going to get messy!

    I've heard it has to do with .htaccess, so I've put this in below, the install is at the root of a server in Public_html, everything else is as standard as it comes, server info in the error below, server has plenty of memory but I had the host double it for 7 days, no difference.

    Ideas???

    .htaccess:

    #BEGIN s2Member GZIP exclusions
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+
    RewriteRule .* - [E=no-gzip:1]
    </IfModule>
    # END s2Member GZIP exclusions

    #Made Multi-Site with Multi-Site Enabler 1.5#
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    RewriteRule . index.php [L]

    Error:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Apache/2.2.3 (CentOS) Server Port 80

  2. michaeljdornan
    Member
    Posted 1 year ago #

    Apache Error log also below xxxxx'd out some parts:

    [Thu Jul 19 12:00:55 2012] [warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function
    [Thu Jul 19 12:01:04 2012] [warn] mod_fcgid: stderr: PHP Warning: Missing argument 1 for YD_OptionPage::YD_OptionPage(), called in /home/xxxxxxx/public_html/wp-content/plugins/yd-buddypress-feed-syndication/inc/ydbfs.inc.php on line 479 and defined in /home/xxxxxxx/public_html/wp-content/plugins/yd-buddypress-feed-syndication/inc/yd-widget-framework.inc.php on line 458
    [Thu Jul 19 12:17:36 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:17:36 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxx.net/
    [Thu Jul 19 12:17:36 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:17:36 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxx.net/
    [Thu Jul 19 12:18:09 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:18:09 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxx.net/
    [Thu Jul 19 12:18:11 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:18:11 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxxx.net/
    [Thu Jul 19 12:18:34 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:18:34 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxxx.net/
    [Thu Jul 19 12:18:34 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:18:34 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxxx.net/
    [Thu Jul 19 12:18:41 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:18:41 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxxxx.net/
    [Thu Jul 19 12:18:44 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:18:44 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxxx.net/
    [Thu Jul 19 12:19:07 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:19:07 2012] [error] [client 202.129.124.xxx] Premature end of script headers: ajax-comments.js.php, re

  3. I would guess it's a memory thing, to be honest. Though you seem to have used a plugin to enable Multisite, and that's never a good thing (Multisite is not incomprehensible to set up, and if you can't figure it out, you are in for a world of hurt when it comes to debugging, since a lot of that is manual).

    How much PHP memory are you allocated?

  4. michaeljdornan
    Member
    Posted 1 year ago #

    Hi Ipstenu - sorry it took so long, see below, your thoughts?:

    ;;;;;;;;;;;;;;;;;;;
    ; Resource Limits ;
    ;;;;;;;;;;;;;;;;;;;

    max_execution_time = 30 ; Maximum execution time of each script, in seconds
    max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
    memory_limit = 128M ; Maximum amount of memory a script may consume

  5. You may need to bump the limit to 256M.

  6. michaeljdornan
    Member
    Posted 1 year ago #

    Hi @Ipstenu - don't suppose you have any other ideas on this?

    I have another php site on this server, if I open 50 pages on that site at the same time, it takes a while but they all open...

    If I open 20 pages on my WP/BP site, 10 of them load and 10 of them give me the 500 Internal Server Error.

    I upped my memory limit in php.ini to 256, nothing, then 512, no better and brought it back to 256.

    Interms of Server memory:
    Virtual memory 3.91 GB total, 0 bytes used
    Real memory 3.86 GB total, 787.31 MB used
    Local disk space 44.63 GB total, 6.99 GB used
    CPU load averages 0.23 (1 min) 0.35 (5 mins) 1.87 (15 mins)
    Kernel and CPU Linux 2.6.18-128.el5 on x86_64

    It's a blackbox IBM server, host unwilling to help.

    I've changed my .htaccess to look like this:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    #BEGIN s2Member GZIP exclusions
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+
    RewriteRule .* - [E=no-gzip:1]
    </IfModule>
    # END s2Member GZIP exclusions

    I moved the site to anther shared cpanel host, same issue, I deactivated all my plugins except Buddypress, same issue.

    Scratching my head.... not sure what my next steps are

  7. Pssst. See the 'code' button above the reply box? Use that to wrap your code in backticks. Makes it easier to read.

    A better, bigger, server, where you can optomize it. Or a caching plugin.

    If your server's having that much trouble, you're going to need at looking to go bigger.

  8. michaeljdornan
    Member
    Posted 1 year ago #

    @Ipsyenu - whooops sorry... so I have just discovered something, in my Virtualmin console I have some options

    PHP script execution mode:

    Apache mod_php (run as Apache's user)
    CGI wrapper (run as virtual server owner)
    FCGId (run as virtual server owner)

    It was set to FCGId, I set it to CGI Wrapper, opened 20 pages, same issue, I then set it to Apache mod_php and opened 20 pages, it took forever for them to open, but eventually they all did, without errors...

    Would match my orignal post with errors in the log for:
    [Thu Jul 19 12:17:36 2012] [warn] mod_fcgid: read data timeout in 31 seconds
    [Thu Jul 19 12:17:36 2012] [error] [client 202.129.124.xxx] Premature end of script headers: index.php, referer: http://xxxxxx.net/

    Still think the server needs more grunt? or do I have a rouge script?

  9. WP doesn't use CGI, however you may be using one of the flavors of PHP that does, and yes, that could be a problem.

    The popular PHP handlers are

    suphp
    DSO
    CGI

    Which are you using?

  10. michaeljdornan
    Member
    Posted 1 year ago #

    Hi @Ipstenu, I'm using php5 , Apache version 2.2.3, on CentOS Linux 5.3 with MySQL version 5.0.95

    In terms of PHP script execution mode, I have 3 options:

    Apache mod_php (runs slow as a dog)
    CGI wrapper (I've tried this, doesn't make any difference)
    FCGId (this is what it is set to right now, was by default)

  11. Right, there's the issue, fast CGI uses a lot more memory :/

  12. michaeljdornan
    Member
    Posted 1 year ago #

    Yep got it, thanks once again Mika :)

Topic Closed

This topic has been closed to new replies.

About this Topic