How to optimize hosting for running Magento?
Basic guide on how to optimize a VPS or dedicated server for running Magento.
Use PHP5.4 or newer.
Example of some php.ini settings:
realpath_cache_size = 32k
realpath_cache_ttl = 7200
max_execution_time = 90
max_input_time = 90
memory_limit = 256M
default_socket_timeout = 90
pdo_mysql.cache_size = 2000
output_buffering = 4096
Use the latest stable MySQL version, or alternatively use Percona or MariaDB.
Percona offer a MySQL configuration wizard , use that to get your initial configuration values for MySQL.
Then install MySQLTuner and use it to monitor and adjust the configuration settings over time.
Add APC (PHP accelerator/OpCode Cache).
Step 1. Install APC and enable it in php.ini.
Example php.ini settings:
Step 2. Use APC as Magentos fast backend.
In your Magento install in the file ./app/etc/local.xml add the following just before the closing tag.
Optional: Use a Content Delivery Network (CDN) for delivering static files like js, css and images.
Sign Up for a CDN account, for instance at Amazon CloudFront and get your cdn url(s).
Optional: Disable Apache AllowOverrides
This will eliminating directory structure scans for .htaccess files and as such the htaccess will not be used anymore, so you will have to add the wanted rules to the configuration for this virtual host instead.
For optimization of your Magento shop read our Magento Speed Optimization Guide.
Using whats described above should give you a clear improvement in speed, but there are possible further advantages to be had using more advanced optimization as well as adding Nginx, Redis, Memcahed, OPcache, Varnish +++.