Archive for the ‘Apache’ Category

500 error message internal site down

Posted: February 3, 2013 in Apache

There are lot of reason for 500 error message internal site down:

One of the reason are mentioned in the below snippet:

==========

root@r9wk [~]# ps aux | grep nichehea | wc -l
477
==========

Please note that the maximum number of processes that can run under a user is 25. If this is exceeded, the sites will through 500 error message.


You can install Xcache without running EasyApache by using /scripts/phpextensionmgr. This script will install the following PHP extensions:

Code:
# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
Xcache
SourceGuardian
PHPSuHosin

The usage is as follows:

Code:
# /scripts/phpextensionmgr
Usage:
phpextensionmgr [options] [action] [extension]

Options:
–help       Help message
–prefix     Installation prefix for PHP (normally /usr/local or /usr/local/php4)

Actions:
install      Install or update the extension
uninstall    Uninstall the extension
status       Display the installation status of the extension
list         Show available extensions

Note: Since PHP extensions only required an extension= line in the php.ini file, there is no need to rebuild all of Apache and PHP. /scripts/phpextensionmgr is much more convenient and much faster than running EasyApache to install these extensions

You should not need to do this every time you run EasyApache. However, to make sure all your extensions are still installed, run php -v after you run EasyApache. You will see each extension that is installed listed. Here is an example from a test server (that does not have Xcache installed):


Speed it up using gzip compress and mod_deflate. Add the following code in the .htaccess file under website folder, save it . Site should be loading pages significantly faster now!

### Enable gzip compression for PHP files
php_value output_handler ob_gzhandler

### compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

### End of compression code

‎* Note: This article only applies to Linux hosting. On IIS, compression is normally enabled on server level. *