Like many web developers I use Plesk on Media Temple’s (dv) Base server. Owing to growing popularity of this blog the server is straining a little. I’ve followed the excellent articles over at David Seah’s site and also the performance optimsation tips on the Media Temple site with good results. But I was still getting memory issues. Whilst the tips are specific to a Media Temple (dv) 3 server they should be good for most linux distros. I must stress I take no responsibility for using this article. Use at your own risk. Everyone is here to learn so if you feel you can add something please do so by leaving a comment.
In Part 1 we’re going to look at ExpressionEngine and making sure your site is set up to be lean, mean and fast. Out of the box EE does a good job of managing performance. The ExpressionEngine documentation explains the caching options available to you.
One area where EE is a little weak (probably so it is easy to install and use on many different platforms) is in the information it sends to the browser. If you are on a Apache server on Linux and AllowOverride is on you’ll be able to speed up things further using an .htaccess file or better still modifying the Apache configuration.
Here’s an the default file I use for .htaccess
FileETag none # Turn off ETag # Set Language and Character Set AddDefaultCharset utf-8 AddLanguage en-gb .en # Ensure GZIP Compression is on php_value output_handler ob_gzhandler # Cache images and set default on everything else ExpiresActive on ExpiresDefault A259200 ExpiresByType image/gif A1209600 ExpiresByType image/png A1209600 ExpiresByType image/jpeg A1209600 ExpiresByType image/gif A1209600 # Set css and js so they can be gzipped <IfModule mod_mime.c> AddType application/x-httpd-php .css AddType application/x-httpd-php .js </IfModule> # Turn off errors php_value display_errors off # Config settings for ExpressionEngine AcceptPathInfo On Options +FollowSymLinks
<?php header("Content-type: text/css"); ?>
Finally I want to make absolutely sure PHP errors are not shown and I turn on a couple of settings for EE. If you get an internal server error it is likely your host does not allow you to override certain settings. Get in touch with you host and ask. These work ok on (mt)(dv)3.
In part two I’ll be looking at optimising the hardware side of things on the (dv) 3.
Have an update or suggestion for this article? You can edit it here and send me a pull request.
Using HashiCorp Vault with LDAP
How to use HashiCorp Vault to setup an LDAP backed secret store with read-only access for users in groups and read-write access for specific users
Linux and Unix xargs command tutorial with examples
Tutorial on using xargs, a UNIX and Linux command for building and executing command lines from standard input. Examples of cutting by character, byte position, cutting based on delimiter and how to modify the output delimiter.
Copy a file in Go
How to copy a file in Go. The ioutil package does not offer a shorthand way of copying a file. Instead the os package should be used.