Magento Optimised Template CentOS 6 with cpanel/whm V1.0



Similar documents
OVERVIEW Methodology Objectives Terminology Recommended Test Protocol... 3 CLOUD SERVICES VS. DEDICATED HOSTING...

How to Install SMTPSwith Mailer on Centos Server/VPS

Linux VPS with cpanel. Getting Started Guide

The current version installed on your server is el6.x86_64 and it's the latest available.

About This Document 3. Integration Overview 4. Prerequisites and Requirements 6

Optimizing TYPO3 performance

MAGENTO Migration Tools

MAGENTO HOSTING Progressive Server Performance Improvements

Wednesday, October 10, 12. Running a High Performance LAMP stack on a $20 Virtual Server

Parallels Plesk Automation

Bubble Full Page Cache for Magento

Local Caching Servers (LCS): User Manual

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

Document History Revision Date: October 30, 2006

Optimizing your Magento store for heavy API access. 1.0 June 2013

Moving to Plesk Automation 11.5

Bazaarvoice for Magento

CYCLOPE let s talk productivity

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

Kollaborate Server Installation Guide!! 1. Kollaborate Server! Installation Guide!

ProjectPier v Getting Started Guide

Bubble Full Page Cache for Magento

Magento Enterprise Edition White Paper!!"#$%&'()*&(+"'#(,-).#/."'(0%-(1/2$(,"-0%-3)*."("4%33"-."!

WHM Administrator s Guide

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

E-commerce is also about

vtiger CRM 4.2 Installation Guide for Linux OS

Server Installation/Upgrade Guide

Installation and Deployment

OpenCart AliExpress Affiliate Plugin User Guide

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

Expresso Quick Install

Partek Flow Installation Guide

LAMP Quickstart for Red Hat Enterprise Linux 4

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

GroundWork Monitor Open Source Installation Guide

Installing Booked scheduler on CentOS 6.5

Host your websites. The process to host a single website is different from having multiple sites.

Closing the Loop: Automating Server Setups. Vanessa Vasile, InMotion Hosting

Shop by Manufacturer Custom Module for Magento

VMware Identity Manager Connector Installation and Configuration

Installing an open source version of MateCat

EZblue BusinessServer The All - In - One Server For Your Home And Business

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

CloudOYE CDN USER MANUAL

VPS Geek Guide. cpanel/whm

Tonido Cloud Admin Guide

About this Guide Web Hosting...6 Concepts... 6

dotdefender v5.12 for Apache Installation Guide Applicure Web Application Firewall Applicure Technologies Ltd. 1 of 11 support@applicure.

Software Environment. Options. Service guarantee:. 24/7 Hardware Support. 99% uptime

TANDBERG MANAGEMENT SUITE 10.0

Syncplicity On-Premise Storage Connector

SOA Software API Gateway Appliance 7.1.x Administration Guide

Camilyo APS package by Techno Mango Service Provide Deployment Guide Version 1.0

NGASI Shared-Runtime Manager Administration and User Guide WebAppShowcase DBA NGASI

WebHost Manager 7 User Guide DOCUMENTATION VERSION: 1.2

OpenCart AliExpress Retail Plugin User Guide

Content Management System

How To Use Ngnix (Php) With A Php-Fpm (Php-Fmm) On A Web Server (Php5) On Your Web Browser) On An Ubuntu Web Server On A Raspberry Web 2.5 (Net

Selling Virtual Private Servers. A guide to positioning and selling VPS to your customers with Heart Internet

Mirtrak 6 Powered by Cyclope

W3Perl A free logfile analyzer

Advanced 100 GB storage space. Unlimited monthly bandwidth. Pro 150 GB storage space. Unlimited monthly bandwidth. Horde Squirrelmail Round Cube Mail

GlobalSign Solutions

Applications Manager Best Practices document

Semantic based Web Application Firewall (SWAF - V 1.6)

Core Protection for Virtual Machines 1

Pcounter Web Report 3.x Installation Guide - v Pcounter Web Report Installation Guide Version 3.4

XCloner Official User Manual


Installation Manual for Catalog Infinite Scroll extension

OnCommand Performance Manager 1.1

Comodo Web Application Firewall Software Version 2.11

OS Installation Guide Red Hat Linux 9.0

Alinto Mail Server Pro

OpenCart. SugarCRM CE (Community Edition Only) Integration. Guide

owncloud Enterprise Edition on IBM Infrastructure

AJ Matrix V5. Installation Manual

ULTEO OPEN VIRTUAL DESKTOP UBUNTU (PRECISE PANGOLIN) SUPPORT

Igor Seletskiy. CEO, CloudLinux

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

ServerPronto Cloud User Guide

Livezilla How to Install on Shared Hosting By: Jon Manning

Interworks. Interworks Cloud Platform Installation Guide

Dedicated Servers InfoGuide

Prerequisites and Configuration Guide

Deploying IBM Lotus Domino on Red Hat Enterprise Linux 5. Version 1.0

42goISP Documentation

IBM Cloud Manager with OpenStack

Comodo Web Application Firewall Software Version 2.0

Serving 4 million page requests an hour with Magento Enterprise

WEB2CS INSTALLATION GUIDE

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

Drupal Performance Tuning

EZblue BusinessServer The All - In - One Server For Your Home And Business

Transcription:

Magento Optimised Template CentOS 6 with cpanel/whm V1.0 Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 1

Contents Introduction... 2 Objectives... 3 Web Server Optimisation... 5 Web Server & Caching Nginx & Varnish... 7 Database Optimisation... 9 PHP Optimisation... 11 Alternative PHP Cache (APC)... 12 Additional Optimisations... 15 IMPORTANT: If you have NOT purchased the Server Management add-on for your service, Technical Support cannot provide any assistance regarding the features, settings, modifications or changes offered in this guide. For more information please see: http://www.crucial.com.au/services/server-management Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 2

Introduction This template does not include an installation of Magento, it is purely an optimised operating system for your Magento installation to run on. Objectives The purpose of this template is to provide a range of performance based configuration options for your Magento installation. As you should be well aware, Magento is both highly resource intensive and highly configurable. Configurations will also vary wildly based on your available resources, your actual site and your actual traffic. Whilst we are attempting to lay the groundwork for a high-performance OS environment for your Magento install as a compliment to your SSD based Blaze Cloud VPS, please be aware that you will need to ensure you both understand the environment configuration and how to tune it in order to gain optimal performance for your Magento installation. Before You Start Please note that a temporary 192.168.x.x IP address has been specified in the default shared IP in WHM. Your first step should be to modify this to one of your assigned Blaze VPS IP addresses eg. your primary IP. You can modify this when you first login to WHM, on Step 3 of the cpanel Setup Wizard (Click Remove for the 192.160.x.x IP). Or after logging into WHM; WHM >> Server Configuration >> Basic cpanel & WHM Setup>> Basic Config >> The IP Address (only one address) that will be used for setting up shared IP virtual hosts >> Enter in your primary IP Address. If this is not set correctly, any cpanel account you create will be setup in the Apache httpd.conf with a non-existent private IP. This will cause numerous issues with Nginx. Updating Your Hostname Once you have updated your server hostname (during the cpanel Setup Wizard or manually), you will need to reboot to complete the change. This will also prevent any issues with MySQL. Updating cpanel/whm You may also wish to perform a cpanel update to ensure you re running the latest version. WHM >> Server Configuration >> Update Preferences >> Choose your Release Tier eg. Release >> Click Save >> Click Update Now Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 3

Or via command line run: # /scripts/upcp --force Starting ApacheBooster (Nginx+Varnish) Once you have created a cpanel account for your Magento installation and once DNS is pointing to the server if your domain is failing to load you should ensure Apachebooster is started correctly. Via command line run: # service apachebooster restart This service will restart the 3 underlying services and should return pid s for nginx, varnishd & httpd (apache) Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 4

Web Server Optimisation Apache Configuration Apache has been configured via EasyApache. A profile named magento-optimized with the values below has been saved which you can modify as required. Apache 2.2.24 PHP 5.3.26 -------- Asis AuthnDefault Deflate Env Expires ModFCGID (fastcgi support) Fileprotect Headers MPM Prefork Mod SuPHP Proxy Version -------- Bcmath CGI Calendar CurlSSL FTP GD Gettext Iconv Imap Mbregex Mbstring Mcrypt Mysql Mysql of the system Openssl PDO PDO MySQL POSIX Path Info Check Pear Phar SOAP SQLite3 Sockets Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 5

TTF(FreeType) Zip Zlib Additional Changes The following changes have been made to Apache via the WHM include editor, modifying the pre_main_global.conf include file with the following: KeepAlive On KeepAliveTimeout 2 KeepAlive allows multiple requests to be sent over the same TCP connection. You will need to make sure your Magento installation is making use of this feature. Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 6

Web Server & Caching Nginx & Varnish ApacheBooster v1.9 Nginx is a superior static web server to Apache. Varnish is a caching HTTP reverse proxy and allows you to cache PHP content and deliver it extremely fast. The two combined together results in an extremely high performance solution. As cpanel is installed with this template, getting Nginx and/or Varnish to work as web server requires a little more work than on a standalone OS. However, it is ready to go out of the box and greatly simplifies setup & configuration. There are several Nginx and/or Varnish plugin options for cpanel servers. Most have license fees ranging from $5-20/month or one-time fees. Most of these plugins are very well received and your license fee may include additional support features. If you have a particular preference or existing plugin license, certainly remove the plugin (see Uninstall step below) included in this template and install your plugin of choice. You can view a list of available Nginx and Varnish related plugins in the cpanel App catalog here: http://applications.cpanel.net/?s=nginx+varnish&cat=select+a+category&x=0&y=0 For this template we have chosen ApacheBooster as it has matured greatly over the last 1-2 years, is well regarded and is free! ApacheBooster integrates Nginx & Varnish to help reduce the server load and memory usage that would be present with just Apache. Note: as this is a free plugin, support is obviously limited, your system administrator should make sure they are familiar with Nginx, Varnish and troubleshooting operations of ApacheBooster eg. restarting services & changing config variables. URL: http://applications.cpanel.net/apachebooster-4/ Homepage: http://www.prajith.in/category/apachebooster/ Install (Already done) wget http://prajith.in/downloads/apachebooster.tar.gz tar -zxf apachebooster.tar.gz cd apachebooster sh install.sh Uninstall (if required) cd apachebooster sh uninstall.sh Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 7

Configuration ApacheBooster can be configured from WHM >> Plugins >> ApacheBooster IMPORTANT: ApacheBooster inserts Nginx as the default web server instead of Apache. This is done by moving Nginx to handle http traffic on port 80 and moving Apache to port 82. Port 8082 is also required while Varnish operates on port 6082. If you are running a firewall (strongly recommended) please make sure you enable port 82, 8082 and 6082 in your firewall configuration. From the ApacheBooster panel you can perform the following operations which are extremely simple & intuitive: Restart ApacheBooster (this will restart apache, nginx & varnish) Modify the Nginx & Varnish configuration Tune Varnish variables (such as the Memory Cache amount & Static & Dynamic File Cache TTL values) Purge Varnish cache Rebuild your Vhosts (This should be done after adding any cpanel accounts) Show Connection Stats Check for Upgrade Magento & Varnish: For easier management of Varnish from you Magento backend, we recommend installing the PageCache extension: http://www.magentocommerce.com/magento-connect/phoenix/extension/6322/varnish_cache Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 8

Database Optimisation MySQL Configuration innodb_file_per_table = 1 #innodb_buffer_pool_size = >50% of total RAM innodb_buffer_pool_size = 1G #innodb_thread_concurrency = 2 * [numberofcpus] + 2 innodb_thread_concurrency = 6 innodb_flush_log_at_trx_commit = 2 innodb_autoextend_increment=512 #thread_concurrency = [number of CPUs] * 3 thread_concurrency = 6 thread_cache_size = 32 table_cache = 1024 query_cache_size = 64M query_cache_limit = 2M join_buffer_size = 8M tmp_table_size = 256M key_buffer = 32M max_allowed_packet = 16M max_heap_table_size = 256M read_buffer_size = 2M read_rnd_buffer_size = 16M bulk_insert_buffer_size = 64M myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 NOTE: these settings will depend greatly on your available resources and your Magento installation requirements. A perl MySQL tuner script is has been downloaded in the /root/ folder. You can run via command line: # perl mysqltuner.pl Additional MySQL Tuning Slow Query Log has been enabled in My.cnf slow_query_log = 1 slow_query_log_file = /var/lib/mysql/slow-query.log long_query_time=2 The purpose of the slow_query_log setting is to log any database queries that are over a certain, in this instance 2 seconds set by long_query_time=2 Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 9

Note: This does not mean all queries that appear in the slow-query.log file will be problematic, it merely logs slow results as a source for tracking down queries that are a potential performance drain. Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 10

PHP Optimisation PHP 5.3.26 has been specified (Note 5.4 is 20% faster than v5.3.x however current Magento compatibility may pose issues for some installations and not recommended just yet). Magento Required PHP extensions PDO_MySQL simplexml mcrypt hash GD DOM iconv curl SOAP (required for Webservices API) PHP.ini Recommended Settings memory_limit = 256M //256M as minimum 512M or higher preferred! safe_mode = Off log_errors = On output_buffering = On realpath_cache_size = 32k realpath_cache_ttl = 7200 max_execution_time = 30 //As low as possible requires testing under load max_input_time = 30 default_socket_timeout = 90 pdo_mysql.cache_size = 2000 output_buffering = On PHP Error Reporting Error reporting is set to E_ALL and display_errors turned Off by default. In development/testing set display_errors = On. This provides you with visual troubleshooting cues that you have PHP errors. In production set display_errors = Off. Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 11

Alternative PHP Cache (APC) APC caches PHP code and runs it from memory, thus drastically reducing overhead on each PHP request and thus the server response time and is an extremely easy to configure performance boost. As Varnish is configured via the ApacheBooster plugin, we have left APC enabled. However running both Varnish + APC may be redundant. Should you wish to disable APC all you need to do is modify the php.ini with apc.enabled = 0 (1 = enable). APC version 3.1.13 has been pre-installed. Installation has been done via WHM under the Module Installers section. WHM >> Software >> Module Installers >> PHP Pecl >> Manage extension=apc.so has been added in the php.ini along with following APC configuration variables: apc.enabled = 1 //enabled by default however Varnish is performing PHP caching under Apachebooster apc.optimization = 0 apc.shm_segments = 1 apc.shm_size = 256M apc.ttl = 7200 apc.user_ttl = 7200 apc.num_files_hint = 10000 Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 12

apc.user_entries_hint = 10000 apc.enable_cli = 1 apc.nmap_file_mask = /tmp/apc.xxxxxx apc.cache_by_default = 1 apc.max_file_size = 10M apc.include_once_override = 0 NOTE: In order to enable APC for your Magento install you must complete the following: 1) Copy the following file /usr/local/lib/php/apc.php to the root web directory of your Magento installation. 2) You must also specify a username and password by modifying this file 3) In order to use APC as the opcode cache storage for your Magento install you must modify your app/etc/local.xml file. For example: 1) cp /usr/local/lib/php/apc.php /home/<cpaneluser>/public_html/ 2) vi /home/<cpaneluser>/public_html/apc.php Edit lines 41 & 42 specifying ADMIN_USERNAME & ADMIN_PASSWORD Additionally you may: You can then load this file in a browser eg. http://domain.com/apc.php -- click on login and use the details you have set. 3) vi /home/<cpaneluser>/public_html/app/etc/local.xml Edit the file making sure the lines in bold are added. <global> <cache> <backend>apc</backend> <prefix>mgt_</prefix> </cache> </global> Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 13

Recommended Settings apc.enabled = 1 //enables apc apc.shm_size = 256M //this is the shared memory size for APC ie. The amount of memory dedicated to cache. Set as high as possible depending on your catalog single installation 128-256Mb. Consider allocating >1-2GB if you are using full page caching apc.enable_cli = 1 // allows cron processes to use the magento cache apc.ttl = 0 //used to auto clean the data cache. Fragmentation will grow as items expire setting to zero will prevent expiry. You will have to manually clear the cache on occasion should it become full or set higher value for apc.shm_size Monitoring & Fine Tuning You will need to utilise the apc.php file installed in your web root to monitor the opcode caching efficiency of APC and adjust accordingly. Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 14

Additional Optimisations Disk Optimisation Your Blaze Cloud VPS is already operating on all SSD Storage with blazing fast IO capabilities. This alone makes several Magento performance tweaks required for traditional SATA or SAS based storage redundant. For example, a common tweak is to store dynamic data (var/cache, var/session) in a memory-based file system such as a RAMdisk or tmpfs which reduces overall Disk IO. Our testing has shown this is general unnecessary on Blaze SSD VPS performs fast enough to cover this. Even so, we recommend enabling the noatime variable for your primary partition variable in the mount options area of /etc/fstab Edit /etc/fstab eg. # vi /etc/fstab Make sure your primary partition mount options look like the following. Add in noatime as below, save & reboot. /dev/xvda1 / ext3 usrjquota=quota.user,jqfmt=vfsv0,noatime 1 1 The noatime variable is a Linux file system mount option which disables recording of last access time (not to be confused with last modified time which is not effected). This saves the file system from a write operation every time a file is accessed which can lead to significant performance gains. Extra Yum Repositories & Packages The CentOS EPEL repository & REMI repositories have been added to the server. wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm; rpm -Uvh epel-release-6*.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6*.rpm The following additional system administration packages have been pre-installed: atop htop sysstat dstat innotop All of these packages provide invaluable advanced system admin & monitoring output options for Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 15

system performance tweak. Please consult the relevant manual pages for these packages to familiarise you with their usage. Common File Locations PHP Configuration = php.ini = /usr/lib/php.ini APC Configuration = apc.php = /usr/local/lib/php/apc.php MySQL Configuration = my.cnf = /etc/my.cnf MySQL Error Log = /var/lib/mysql/<hostname>.err MySQL Slow Query Log = /var/lib/mysql/slow-query.log Apache Configuration = /usr/local/apache/conf/httpd.conf (Note: this file is modified by cpanel. Changes must be done using includes: WHM >> Apache Configuration >> Include editor) Apache Global Includes = vi /usr/local/apache/conf/includes/pre_main_global.conf Nginx Vhost directory = /usr/local/nginx/vhost/<domainname>.conf End. Magento Optimised Template CentOS 6 with cpanel/whm Crucial Cloud Hosting 16