{"id":16366771,"url":"https://github.com/centminmod/centminmod-magento2","last_synced_at":"2025-03-23T02:32:39.805Z","repository":{"id":80279563,"uuid":"124850088","full_name":"centminmod/centminmod-magento2","owner":"centminmod","description":"Magento 2.2.2 Install Guide For Centmin Mod Nginx LEMP Stacks","archived":false,"fork":false,"pushed_at":"2018-06-27T15:41:19.000Z","size":907,"stargazers_count":17,"open_issues_count":3,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T16:53:00.468Z","etag":null,"topics":["cache","centminmod","magento","magento-2","magento-cache","magento2","nginx","nginx-proxy","redis","redis-cache","redis-server","varnish-5","varnish-52","varnish-cache","wrk","wrk-cmm"],"latest_commit_sha":null,"homepage":"","language":"VCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-12T07:26:37.000Z","updated_at":"2025-03-07T16:45:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"10ec7981-6407-4746-a831-31cce8a0a053","html_url":"https://github.com/centminmod/centminmod-magento2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-magento2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-magento2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-magento2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-magento2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/centminmod-magento2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245047977,"owners_count":20552430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","centminmod","magento","magento-2","magento-cache","magento2","nginx","nginx-proxy","redis","redis-cache","redis-server","varnish-5","varnish-52","varnish-cache","wrk","wrk-cmm"],"created_at":"2024-10-11T02:47:31.850Z","updated_at":"2025-03-23T02:32:39.758Z","avatar_url":"https://github.com/centminmod.png","language":"VCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Magento 2.2.2 Install Guide For Centmin Mod Nginx LEMP Stacks\n\n## Table Of Contents\n\n* [Introduction](https://github.com/centminmod/centminmod-magento2#introduction)\n* [Centmin Mod 123.09beta01 LEMP Stack Install](https://github.com/centminmod/centminmod-magento2#centmin-mod-12309beta01-lemp-stack-install)\n* [Magento 2.2.2 Installation](https://github.com/centminmod/centminmod-magento2#magento-222-installation)\n* [Magento 2 Upgrade](https://github.com/centminmod/centminmod-magento2#magento-2-upgrade)\n* [Magento 2 Page Speed Tests](https://github.com/centminmod/centminmod-magento2#magento-2-page-speed-tests)\n* [Magento 2 Redis Benchmarks](https://github.com/centminmod/centminmod-magento2#magento-2-redis-benchmarks)\n  * [Magento 2 File Based Caching Benchmarks](https://github.com/centminmod/centminmod-magento2#benchmarks-with-redis-caching-disabled)\n* [Magento 2 Varnish Cache Config \u0026 Benchmarks](https://github.com/centminmod/centminmod-magento2#magento-2-varnish-cache)\n  * [Varnish Cache Benchmark Test Results](https://github.com/centminmod/centminmod-magento2#varnish-cache-benchmark-test-results)\n* [Magento 2 Backups](https://github.com/centminmod/centminmod-magento2#magento-2-backups)\n* [Magento 2 Install And Remove Sample Data](https://github.com/centminmod/centminmod-magento2#magento-2-install-and-remove-sample-data)\n* [Magento Docs \u0026 Info Links](https://github.com/centminmod/centminmod-magento2#magento-docs--info-links)\n* [Magento 2 Bugs](https://github.com/centminmod/centminmod-magento2#magento-2-bugs)\n\n## Introduction\n\nThis Magento 2.2.2 installation guide is written by George Liu (eva2000) and is **provided as is without any support** and was written specifically for Magento 2.2.2 installs on [Centmin Mod 123.09beta01](https://centminmod.com/) or higher branch LEMP stack installations running Nginx 1.13 branch with PHP-FPM 7.1.x latest (Magento 2.2.2 doesn't support PHP 7.2 yet) and MariaDB 10.1.31 MySQL server. Magento 2.2.2 install below will be via Composer download and native Magento binary command tool and is 100% pure SSH command line install. FTP/SFTP is not used at all. The below Magento install steps could be used to write an automated script to install Magento 2.2.2 on Centmin Mod LEMP stacks purely from SSH command line. Maybe something planned on offer to [Centmin Mod Premium Members](https://community.centminmod.com/premium/). Update: added a [Magento 2 Bugs section](https://github.com/centminmod/centminmod-magento2#magento-2-bugs) of which one bug already affects Magento 2.2.2 causing high MySQL / PHP related loads.\n\n**Disclaimer:** \n\nI have never used Magento before so this is first attempt at installing Magento 2.2.2 after a quick read of the official Magento 2.2.2 documentation and Magento related info links outlined below in [Magento Docs \u0026 Info Links](https://github.com/centminmod/centminmod-magento2#magento-docs--info-links) section. I haven't gone beyond the initial Magento installation, so have no experience with managing and administrating Magento 2.2 application nor have I have any experience with Magento themes etc. It's purely a first time attempt outline for Magento 2.2.2. Hence, why I decided to setup this Magento install guide on a Github repository instead of the [official Centmin Mod Community forums](https://community.centminmod.com/) so I can accept contributions and corrections to the below guide via Git pull requests. This is how I usually learn - lots of reading and practice. Just this time I am documenting publicly. Thus this write up guide will undergo revisions over time.\n\nAll below installation steps assume you have thoroughly read those listed [official Magento 2.2.2 documentation and links](https://github.com/centminmod/centminmod-magento2#magento-docs--info-links). So if you do not understand any of the SSH commands used, start reading the listed documentation and links below.\n\n**Github Repository**\n\n* https://github.com/centminmod/centminmod-magento2\n\n![](/screenshots/magento-222-admin-02.png)\n\n## Centmin Mod 123.09beta01 LEMP Stack Install\n\nFirst you need to install Centmin Mod 123.09beta01 LEMP stack on a fresh virgin CentOS 7.4 64bit server using the `betainstaller71.sh` installer which will install Nginx 1.13 branch with MariaDB 10.1.31 MySQL and latest version of PHP 7.1.x branch as PHP-FPM which as of this moment is PHP 7.1.15. Details are [here](https://community.centminmod.com/threads/centmin-mod-09-beta-branch-testing.4128/). You need at least 2GB of memory according to [official Magento 2.2 stack requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html).\n\nFor CentOS users, you want to make sure you're using latest CentOS 7.4 or higher version operating system as the [version of Git and Curl](https://community.centminmod.com/threads/github-com-drops-tlsv1-1-tlsv1-0-support-update-centos-6-9-or-7-4.14206/) are latest versions used to support TLS v1.2 which is required due to [Github.com deprecating TLSv1.0 and TLSv1.1 and Paypal deprecating TLSv1.0](https://community.centminmod.com/threads/github-com-drops-tlsv1-1-tlsv1-0-support-update-centos-6-9-or-7-4.14206/). Magento component repository also [requires TLSv1.1 or newer too](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html).\n\nAs root user in SSH session run the installer via curl:\n\n```\nyum -y update; curl -O https://centminmod.com/betainstaller71.sh \u0026\u0026 chmod 0700 betainstaller71.sh \u0026\u0026 bash betainstaller71.sh\n```\nInstall times vary depending on the server hardware specs, resources available and speed of server i.e. more cpu cores and higher cpu clock speed = faster install times. You can check out other Centmin Mod users' posted install times [here](https://community.centminmod.com/threads/post-your-centmin-mod-123-09beta01-install-time-stats.8866/).\n\nAfter install it is highly recommended to bookmark and read at least these 3 links:\n\n* [Getting Started Guide](https://centminmod.com/getstarted.html)\n* [How to Boost Centmin Mod LEMP Stack Performance](https://centminmod.com/perf/)\n* [Guide To Learning About Centmin Mod](https://community.centminmod.com/threads/guide-to-learning-more-about-centmin-mod.10838/)\n\nCentmin Mod LEMP stack installer takes care of all possible PHP extension requirements for many web applications including, Wordpress, Xenforo, Invision Board, vBulletin, Piwik, and Magento.\n\nList of PHP extensions loaded with PHP 7.1.5 with lzf and lz4 added post initial install\n\n```\nphp -m\n[PHP Modules]\nbcmath\nbz2\ncalendar\nCore\nctype\ncurl\ndate\ndom\nenchant\nexif\nfilter\nftp\ngd\ngeoip\ngettext\ngmp\nhash\niconv\nigbinary\nimagick\nimap\nintl\njson\nldap\nlibxml\nlz4\nlzf\nmailparse\nmbstring\nmcrypt\nmemcache\nmemcached\nmysqli\nmysqlnd\nopenssl\npcntl\npcre\nPDO\npdo_mysql\npdo_sqlite\nPhar\nposix\npspell\nreadline\nredis\nReflection\nsession\nshmop\nSimpleXML\nsnmp\nsoap\nsockets\nSPL\nsqlite3\nstandard\nsysvmsg\nsysvsem\nsysvshm\ntidy\ntokenizer\nxml\nxmlreader\nxmlrpc\nxmlwriter\nxsl\nZend OPcache\nzip\nzlib\n\n[Zend Modules]\nZend OPcache\n```\n\nAfter install, you may want to tweak your PHP-FPM primary main pool settings in `/usr/local/etc/php-fpm.conf`\n\nIf you're on non-OpenVZ based server with ability to run system at TCP /etc/sysctl.conf level, then Centmin Mod LEMP stack installer would have automatically optimised your system at TCP level. So you will be able to make changes like below:\n\nRaise PHP-FPM listen.backlog\n\n```\nlisten.backlog = 8096\n```\n\nchange from `ondemand` to `static` or `dynamic` PHP-FPM process manager in which case tuning `pm.max_children` is left up to you to tune. Note, Centmin Mod LEMP stack install auto tunes these default values on a server based on detected system resources like cpu count and memory, so below settings may not be the same on your Centmin Mod LEMP based server as you may have different server hardware resources and hardware specs.\n\n```\n;pm = ondemand\npm = static\npm.max_children = 8\n; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2\npm.start_servers = 8\npm.min_spare_servers = 4\npm.max_spare_servers = 12\npm.max_requests = 1000\n```\n\nOfficial php.net documentation [here](https://secure.php.net/manual/en/install.fpm.configuration.php).\n\n```\npm string\nChoose how the process manager will control the number of child processes. Possible values: static, ondemand, dynamic. This option is mandatory.\n\nstatic - the number of child processes is fixed (pm.max_children).\n\nondemand - the processes spawn on demand (when requested, as opposed to dynamic, where pm.start_servers are started when the service is started.\n\ndynamic - the number of child processes is set dynamically based on the following directives: pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers.\n```\n\n```\npm.max_children int\nThe number of child processes to be created when pm is set to static and the maximum number of child processes to be created when pm is set to dynamic. This option is mandatory.\n\nThis option sets the limit on the number of simultaneous requests that will be served. Equivalent to the ApacheMaxClients directive with mpm_prefork and to the PHP_FCGI_CHILDREN environment variable in the original PHP FastCGI.\n\npm.start_servers int\nThe number of child processes created on startup. Used only when pm is set to dynamic. Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2.\n\npm.min_spare_servers int\nThe desired minimum number of idle server processes. Used only when pm is set to dynamic. Also mandatory in this case.\n\npm.max_spare_servers int\nThe desired maximum number of idle server processes. Used only when pm is set to dynamic. Also mandatory in this case.\n\npm.process_idle_timeout mixed\nThe number of seconds after which an idle process will be killed. Used only when pm is set to ondemand. Available units: s(econds)(default), m(inutes), h(ours), or d(ays). Default value: 10s.\n\npm.max_requests int\nThe number of requests each child process should execute before respawning. This can be useful to work around memory leaks in 3rd party libraries. For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. Default value: 0.\n```\n\n## Magento 2.2.2 Installation\n\nMagento 2.2.2 install is done purely via SSH command line and the test KVM VPS server is of following specs which meet the [official Magento 2.2 stack requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html).\n\n - 4 CPU Intel 2.40Ghz cpu \n - 4GB memory \n - 80GB disk \n - CentOS 7.4 64bit \n - Centmin Mod 123.09beta01 installed via [betainstaller71.sh](https://community.centminmod.com/threads/centmin-mod-09-beta-branch-testing.4128/)\n - Nginx 1.13.9\n - PHP-FPM 7.1.15 + Zend Opcache\n - MariaDB 10.1.31 MySQL Server\n - CSF Firewall\n\nThe cpu is very old as it doesn't have SSE4.2 which was added back in [Intel Nehalem](https://en.wikipedia.org/wiki/SSE4#SSE4.2) architecture back in 2008 - making this cpu at least 10+ yrs old.\n\n```\nlscpu\nArchitecture:          x86_64\nCPU op-mode(s):        32-bit, 64-bit\nByte Order:            Little Endian\nCPU(s):                4\nOn-line CPU(s) list:   0-3\nThread(s) per core:    1\nCore(s) per socket:    1\nSocket(s):             4\nNUMA node(s):          1\nVendor ID:             GenuineIntel\nCPU family:            6\nModel:                 13\nModel name:            QEMU Virtual CPU version 1.5.3\nStepping:              3\nCPU MHz:               2499.998\nBogoMIPS:              4999.99\nHypervisor vendor:     KVM\nVirtualization type:   full\nL1d cache:             32K\nL1i cache:             32K\nL2 cache:              4096K\nNUMA node0 CPU(s):     0-3\nFlags:                 fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni cx16 hypervisor lahf_lm\n```\n\n### Step 1. Get Magento Authentication Keys\n\nTo install Magento via Composer, you need to register an account to get the Authentication Keys from [Magento Markplace](https://marketplace.magento.com/) and log in and go to Account Profile, Market Place tab and Access Keys to generate a set of Authentictaion Keys. In step 2 next, you will use the public key to assign to SSH variable `magentouser_key`and private key to assign to SSH variable `magentouser_pass`.\n\n### Step 2. Install Magento required components and optional components for optimal performance\n\n#### composer\n\n```\nmagentouser_key=yourmagento_authention_publickey\nmagentouser_pass=yourmagento_authention_privatekey\ncurl -sS https://getcomposer.org/installer | php\nmv -f composer.phar /usr/local/bin/composer\ncomposer config -g repositories.magento '{ \"type\": \"composer\", \"url\": \"https://repo.magento.com/\" }'\ncomposer config -g http-basic.repo.magento.com $magentouser_key $magentouser_pass\n```\n\n#### n98-magerun2 install https://github.com/netz98/n98-magerun2\n\n```\nwget -O /usr/local/bin/n98-magerun2 https://files.magerun.net/n98-magerun2.phar\nchmod +x /usr/local/bin/n98-magerun2\nwget -O /etc/bash_completion.d/n98-magerun2.phar.bash https://github.com/netz98/n98-magerun2/raw/develop/res/autocompletion/bash/n98-magerun2.phar.bash\n```\n\n#### redis server\n\nRedis server is installed from Remi YUM repository using [custom Redis installer](https://github.com/centminmod/centminmod-redis) written for Centmin Mod LEMP stacks and implements the basic Redis server install steps outlined [here](https://community.centminmod.com/threads/how-to-install-redis-server-on-centmin-mod-lemp-stack.4546/).\n\n```\nmkdir -p /root/tools\ncd /root/tools\ngit clone https://github.com/centminmod/centminmod-redis\ncd centminmod-redis\nif [ ! -f /usr/bin/redis-server ]; then ./redis-install.sh install; fi\nservice redis restart\n```\n\nModifying /etc/redis.conf config with\n\n```\nmaxmemory 512mb\nmaxmemory-policy allkeys-lru\nmaxmemory-samples 10\nappendonly yes\n```\n\nIf you are only using redis server for caching and not persistent storage in any web apps on server also comment out and disable snapshotting altogther\n\n```\n#save 900 1\n#save 300 10\n#save 60 10000\n```\n\nYou can also remove the Redis TCP overhead in /etc/redis.conf by also enabling unix socket mode while keep TCP ports for Redis enabled too. Below setups up unixsocket at `/var/run/redis/redis.sock`\n\n```\n# Specify the path for the Unix socket that will be used to listen for\n# incoming connections. There is no default, so Redis will not listen\n# on a unix socket when not specified.\n#\nunixsocket /var/run/redis/redis.sock\nunixsocketperm 777\n```\n\nrestart redis server\n\n```\nservice redis restart\n```\n\ncheck redis server info via unixsocket\n\n```\nredis-cli -s /var/run/redis/redis.sock info server\n# Server\nredis_version:4.0.8\nredis_git_sha1:00000000\nredis_git_dirty:0\nredis_build_id:32fcc4a764b07c42\nredis_mode:standalone\nos:Linux 3.10.0-229.el7.x86_64 x86_64\narch_bits:64\nmultiplexing_api:epoll\natomicvar_api:atomic-builtin\ngcc_version:4.8.5\nprocess_id:1618\nrun_id:21de92709a7ed5f299425ddeb1bf0dd5a7399331\ntcp_port:6379\nuptime_in_seconds:139\nuptime_in_days:0\nhz:10\nlru_clock:10971220\nexecutable:/usr/bin/redis-server\nconfig_file:/etc/redis.conf\n```\n\n#### lz4 compression\n\nNeed to install newer version of lz4 1.8.2 instead of YUM provided 1.7.3 and install lzf and lz4 PHP extensions.\n\n```\ncd /svr-setup || cd /usr/src ; rm -rf lz4; \ngit clone --depth=1 https://github.com/lz4/lz4;\ncd lz4; make clean; if [ -f /opt/rh/devtoolset-7/enable ]; then source /opt/rh/devtoolset-7/enable; fi\nmake -j$(nproc);\nmake install;\nlz4 --help;\n```\nInstalling lz4 PHP extension - you may need to reinstall this if you upgrade PHP to major branch i.e. from PHP 7.1.x to 7.2.x\n```\ncd /svr-setup;\ngit clone --recursive --depth=1 https://github.com/kjdev/php-ext-lz4.git;\ncd php-ext-lz4;\nmake clean;\nphpize;\n./configure --with-php-config=/usr/local/bin/php-config;\nmake -j$(nproc);\nmake install;\nPHPEXTDIRD=$(cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\\047|extension_dir|=|)/,\"\",extdir); print extdir}');\necho \"extension=${PHPEXTDIRD}/lz4.so\" \u003e /etc/centminmod/php.d/lz4.ini;\nfpmrestart\nphp --ri lz4\n```\nInstalling lzf PHP extension - you may need to reinstall this if you upgrade PHP to major branch i.e. from PHP 7.1.x to 7.2.x\n```\ncd /svr-setup;\nwget https://pecl.php.net/get/LZF-1.6.6.tgz;\ntar vzxf LZF-1.6.6.tgz;\ncd LZF-1.6.6;\nmake clean;\nphpize;\n./configure --with-php-config=/usr/local/bin/php-config;\nmake -j$(nproc);\nmake install;\nPHPEXTDIRD=$(cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\\047|extension_dir|=|)/,\"\",extdir); print extdir}');\necho \"extension=${PHPEXTDIRD}/lzf.so\" \u003e /etc/centminmod/php.d/lzf.ini;\nfpmrestart\nphp --ri lzf\n```\n\n#### tuning zend opcache\n\n* magento [recommends](http://devdocs.magento.com/guides/v2.2/config-guide/prod/prod_perf-optimize.html) that opcache.enable_cli=1 is enabled\n* tune and edit custom php.ini settings via custom separate individual .ini settings files outlined at https://centminmod.com/phpfpm.html\n* create custom .ini settings file at /etc/centminmod/php.d/zzz-zendopcache.ini which overrides default /etc/centminmod/php.d/zendopcache.ini\n* allocate 512MB of memory to Zend Opcache but don't set opcache.validate_timestamps=0 and leave at default opcache.validate_timestamps=1\n* raise opcache.max_accelerated_files to 100,000\n* set memory_limit to 1024MB\n\n```\necho -e \"memory_limit=1024M\\nopcache.max_accelerated_files=100000\\nopcache.memory_consumption=512\\nopcache.enable_cli=1\\nsession.gc_maxlifetime=86400\" \u003e /etc/centminmod/php.d/zzz-zendopcache.ini\nfpmrestart\nphp --ini\nphp --ri \"Zend Opcache\"\nphp --ri session\n```\n\ncheck memory_limit which shows local and global values\n\n```\nphp -i | grep memory_limit\nmemory_limit =\u003e 1024M =\u003e 1024M\n```\n\ncheck Zend Opcache settings\n\n```\nphp --ri \"Zend Opcache\"\n\nZend OPcache\n\nOpcode Caching =\u003e Up and Running\nOptimization =\u003e Enabled\nSHM Cache =\u003e Enabled\nFile Cache =\u003e Disabled\nStartup =\u003e OK\nShared memory model =\u003e mmap\nCache hits =\u003e 0\nCache misses =\u003e 0\nUsed memory =\u003e 25161376\nFree memory =\u003e 511709536\nWasted memory =\u003e 0\nInterned Strings Used memory =\u003e 413712\nInterned Strings Free memory =\u003e 7974896\nCached scripts =\u003e 0\nCached keys =\u003e 0\nMax keys =\u003e 130987\nOOM restarts =\u003e 0\nHash keys restarts =\u003e 0\nManual restarts =\u003e 0\n\nDirective =\u003e Local Value =\u003e Master Value\nopcache.enable =\u003e On =\u003e On\nopcache.use_cwd =\u003e On =\u003e On\nopcache.validate_timestamps =\u003e On =\u003e On\nopcache.validate_permission =\u003e Off =\u003e Off\nopcache.validate_root =\u003e Off =\u003e Off\nopcache.inherited_hack =\u003e On =\u003e On\nopcache.dups_fix =\u003e Off =\u003e Off\nopcache.revalidate_path =\u003e Off =\u003e Off\nopcache.log_verbosity_level =\u003e 1 =\u003e 1\nopcache.memory_consumption =\u003e 512 =\u003e 512\nopcache.interned_strings_buffer =\u003e 8 =\u003e 8\nopcache.max_accelerated_files =\u003e 100000 =\u003e 100000\nopcache.max_wasted_percentage =\u003e 5 =\u003e 5\nopcache.consistency_checks =\u003e 0 =\u003e 0\nopcache.force_restart_timeout =\u003e 180 =\u003e 180\nopcache.revalidate_freq =\u003e 180 =\u003e 180\nopcache.file_update_protection =\u003e 2 =\u003e 2\nopcache.preferred_memory_model =\u003e no value =\u003e no value\nopcache.blacklist_filename =\u003e no value =\u003e no value\nopcache.max_file_size =\u003e 0 =\u003e 0\nopcache.protect_memory =\u003e 0 =\u003e 0\nopcache.save_comments =\u003e 1 =\u003e 1\nopcache.fast_shutdown =\u003e 0 =\u003e 0\nopcache.optimization_level =\u003e 0x7FFFBFFF =\u003e 0x7FFFBFFF\nopcache.opt_debug_level =\u003e 0 =\u003e 0\nopcache.enable_file_override =\u003e On =\u003e On\nopcache.enable_cli =\u003e On =\u003e On\nopcache.error_log =\u003e no value =\u003e no value\nopcache.restrict_api =\u003e no value =\u003e no value\nopcache.lockfile_path =\u003e /tmp =\u003e /tmp\nopcache.file_cache =\u003e no value =\u003e no value\nopcache.file_cache_only =\u003e 0 =\u003e 0\nopcache.file_cache_consistency_checks =\u003e 1 =\u003e 1\nopcache.huge_code_pages =\u003e Off =\u003e Off\n```\n\n### Step 3. Download \u0026 Install Magento\n\nBelow steps will download Magento 2.2.2 via Composer and use Magento native `bin/magento` binary to install Magento 2.2.2 on Centmin Mod LEMP stack based CentOS 7.4 64bit server enabling the following optimisations:\n\n* Install Redis 4.0.8+ server\n* Install [n98-magerun2](https://github.com/netz98/n98-magerun2) command line too\n* Install lzf and lz4 PHP extensions\n* Install Magento 2.2.2 with randomised backend Admin url address\n* Enable Magento 2 default, full page cache and session caching using Redis caching with full page cache and session caching using faster lz4 compression type instead of default gzip type\n* Flat based catalogue product and categories\n* Async indexing\n* Async sending of sales emails\n* magento_umask set to 022\n* Create Centmin Mod Nginx HTTP/2 HTTPS based vhost site with Magento 2 nginx configuration rules modified for Centmin Mod Nginx structured layout\n\nFirst use `nv` command outlined [here](https://centminmod.com/nginx_domain_dns_setup.html) to create a Centmin Mod Nginx HTTP/2 HTTPS vhost site with a new `magento2` system user and default `vhostname='magento.domain.com'`variable in SSH session which will be referenced in below steps as `$vhostname` variable.\n\n```\n# setup centmin mod nginx http/2 https vhost site\nvhostname='magento.domain.com'\nadduser magento2\nadduser_pass=\"$(pwgen -1cnys 34)\"\necho \"magento2 user pass: $adduser_pass\"\necho \"$adduser_pass\" | passwd magento2 --stdin\nusermod -a -G nginx magento2\nid magento2\ngroups magento2\necho \"$(curl -4s ipinfo.io/ip) $vhostname\" \u003e\u003e /etc/hosts\n```\nFor Nginx vhost setup via `nv` command using self-signed SSL certificate based HTTP/2 HTTPS:\n\n```\nnv -d $vhostname -s y -u \"ftpu$(pwgen -1cnys 31)\"\n```\nOr instead use free Letsencrypt SSL certificate via `nv` command using Centmin Mod [addons/acmetool.sh](https://centminmod.com/acmetool/) integration script. Just make sure that your default `vhostname='magento.domain.com'` variable domain i.e. `magento.domain.com` has a valid and propagated DNS A record pointing to the Centmin Mod LEMP server's primary IP address. If you are using a non-subdomain name, make sure both non-www and www version of the name both have valid and propagated DNS A records pointing to the Centmin Mod LEMP server's primary IP address **BEFORE** you run the below `nv` command to automatically create a Centmin Mod Nginx HTTP/2 HTTPS vhost site and obtain a free Letsencrypt SSL certificate. The valid DNS A records are need for Letsencrypt domain validation purposes.\n\n\n```\necho \"LETSENCRYPT_DETECT='y'\" \u003e\u003e /etc/centminmod/custom_config.inc\nnv -d $vhostname -s lelive -u \"ftpu$(pwgen -1cnys 31)\"\n```\n\n\nChange into `magento.domain.com` vhost directory one level above the usual web root at `public`, which is `/home/nginx/domains/$vhostname` and move and make a backup copy of the original web root as `public.orig` directory. Then use Composer to download the Magento 2.2.2 source code to a newly created `public` directory and set the appropriate user/group owner permissions on files, directories and the Magento binary.\n\nUpdate: Magento 2.2.3 is latest now so you would change `magento/project-community-edition=2.2.2` to `magento/project-community-edition=2.2.3` instead.\n\n```\n# downloading magento 2.2 code via composer\ncd /home/nginx/domains/$vhostname\nmv public public.orig\ntime composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.2.3 public\ntime composer require predis/predis\n#time composer require ext-phpiredis\ncd public\ntime find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \\;\ntime find var vendor generated pub/static pub/media app/etc -type d -exec chmod u+w {} \\;\nchown -R nginx:nginx \"/home/nginx/domains/${vhostname}/public\"\nchmod u+x bin/magento\n```\nNow the actual Magento 2.2.2 installing via SSH command line using the Magento binary `$WEBROOT/bin/magento` where `WEBROOT` variable and other installation settings are setup in SSH session variables outlined below. Adjust the variables values as needed.\n\nYou can use `$WEBROOT/bin/magento list` command to see all available command options.\n\n```\nphp $WEBROOT/bin/magento list\nMagento CLI version 2.2.2\n\nUsage:\n  command [options] [arguments]\n\nOptions:\n  -h, --help            Display this help message\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nAvailable commands:\n  help                                     Displays help for a command\n  list                                     Lists commands\n admin\n  admin:user:create                        Creates an administrator\n  admin:user:unlock                        Unlock Admin Account\n app\n  app:config:dump                          Create dump of application\n  app:config:import                        Import data from shared configuration files to appropriate data storage\n cache\n  cache:clean                              Cleans cache type(s)\n  cache:disable                            Disables cache type(s)\n  cache:enable                             Enables cache type(s)\n  cache:flush                              Flushes cache storage used by cache type(s)\n  cache:status                             Checks cache status\n catalog\n  catalog:images:resize                    Creates resized product images\n  catalog:product:attributes:cleanup       Removes unused product attributes.\n config\n  config:sensitive:set                     Set sensitive configuration values\n  config:set                               Change system configuration\n  config:show                              Shows configuration value for given path. If path is not specified, all saved values will be shown\n cron\n  cron:install                             Generates and installs crontab for current user\n  cron:remove                              Removes tasks from crontab\n  cron:run                                 Runs jobs by schedule\n customer\n  customer:hash:upgrade                    Upgrade customer's hash according to the latest algorithm\n deploy\n  deploy:mode:set                          Set application mode.\n  deploy:mode:show                         Displays current application mode.\n dev\n  dev:di:info                              Provides information on Dependency Injection configuration for the Command.\n  dev:query-log:disable                    Disable DB query logging\n  dev:query-log:enable                     Enable DB query logging\n  dev:source-theme:deploy                  Collects and publishes source files for theme.\n  dev:template-hints:disable               Disable frontend template hints. A cache flush might be required.\n  dev:template-hints:enable                Enable frontend template hints. A cache flush might be required.\n  dev:tests:run                            Runs tests\n  dev:urn-catalog:generate                 Generates the catalog of URNs to *.xsd mappings for the IDE to highlight xml.\n  dev:xml:convert                          Converts XML file using XSL style sheets\n i18n\n  i18n:collect-phrases                     Discovers phrases in the codebase\n  i18n:pack                                Saves language package\n  i18n:uninstall                           Uninstalls language packages\n indexer\n  indexer:info                             Shows allowed Indexers\n  indexer:reindex                          Reindexes Data\n  indexer:reset                            Resets indexer status to invalid\n  indexer:set-mode                         Sets index mode type\n  indexer:show-mode                        Shows Index Mode\n  indexer:status                           Shows status of Indexer\n info\n  info:adminuri                            Displays the Magento Admin URI\n  info:backups:list                        Prints list of available backup files\n  info:currency:list                       Displays the list of available currencies\n  info:dependencies:show-framework         Shows number of dependencies on Magento framework\n  info:dependencies:show-modules           Shows number of dependencies between modules\n  info:dependencies:show-modules-circular  Shows number of circular dependencies between modules\n  info:language:list                       Displays the list of available language locales\n  info:timezone:list                       Displays the list of available timezones\n maintenance\n  maintenance:allow-ips                    Sets maintenance mode exempt IPs\n  maintenance:disable                      Disables maintenance mode\n  maintenance:enable                       Enables maintenance mode\n  maintenance:status                       Displays maintenance mode status\n module\n  module:disable                           Disables specified modules\n  module:enable                            Enables specified modules\n  module:status                            Displays status of modules\n  module:uninstall                         Uninstalls modules installed by composer\n sampledata\n  sampledata:deploy                        Deploy sample data modules\n  sampledata:remove                        Remove all sample data packages from composer.json\n  sampledata:reset                         Reset all sample data modules for re-installation\n setup\n  setup:backup                             Takes backup of Magento Application code base, media and database\n  setup:config:set                         Creates or modifies the deployment configuration\n  setup:cron:run                           Runs cron job scheduled for setup application\n  setup:db-data:upgrade                    Installs and upgrades data in the DB\n  setup:db-schema:upgrade                  Installs and upgrades the DB schema\n  setup:db:status                          Checks if DB schema or data requires upgrade\n  setup:di:compile                         Generates DI configuration and all missing classes that can be auto-generated\n  setup:install                            Installs the Magento application\n  setup:performance:generate-fixtures      Generates fixtures\n  setup:rollback                           Rolls back Magento Application codebase, media and database\n  setup:static-content:deploy              Deploys static view files\n  setup:store-config:set                   Installs the store configuration. Deprecated since 2.2.0. Use config:set instead\n  setup:uninstall                          Uninstalls the Magento application\n  setup:upgrade                            Upgrades the Magento application, DB data, and schema\n store\n  store:list                               Displays the list of stores\n  store:website:list                       Displays the list of websites\n theme\n  theme:uninstall                          Uninstalls theme\n varnish\n  varnish:vcl:generate                     Generates Varnish VCL and echos it to the command line\n```\n\nDefine your custom variables for Magento 2.2.2 install. I use `pwgen` password generator command to randomise some parts of the values for database name `DBNAME`, database username `DBUSER`, database user password `DBPASS`, Magento admin user password `ADMINPASS` and the backend Admin url `BACKEND_FRONTNAME`.\n\n\n```\n# defining variables\nWEBROOT=\"/home/nginx/domains/${vhostname}/public\"\nIP=$(curl -4s ipinfo.io/ip)\nDBPREFIX='mags_'\nDBNAME=\"magento2$(pwgen -1cnys 4)\"\nDBUSER=\"magento2$(pwgen -1cnys 9)\"\nDBPASS=$(pwgen -1cnys 21)\nADMINUSER=adminuser\nADMINPASS=\"adminpass$(pwgen -1cnys 18)\"\nADMINFNAME=first\nADMINLNAME=last\nADMINEMAIL=your@emaildomain.com\nCURRENCY=USD\nTIMEZONE='America/Chicago'\nBACKEND_FRONTNAME=\"admin_au$(pwgen -1cnys 8)\"\n```\nUse Centmin Mod [addons/mysqladmin_shell.sh](https://community.centminmod.com/threads/mysqladmin_shell-sh-shell-based-addon.543/) script to create the MySQL database, database user and database password based on the above set SSH session variables.\n```\n# create mysql database\necho \"/usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb $DBNAME $DBUSER $DBPASS\"\n/usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb $DBNAME $DBUSER $DBPASS\n```\nNow using php run the `$WEBROOT/bin/magento` binary to install and setup Magento 2.2.2\n```\n# magento installation\ntime php $WEBROOT/bin/magento setup:install --base-url=https://${vhostname}/ \\\n--db-host=localhost --db-prefix=$DBPREFIX --db-name=$DBNAME --db-user=$DBUSER --db-password=$DBPASS \\\n--admin-firstname=$ADMINFNAME --admin-lastname=$ADMINLNAME --admin-email=$ADMINEMAIL \\\n--admin-user=$ADMINUSER --admin-password=$ADMINPASS --language=en_US \\\n--backend-frontname=$BACKEND_FRONTNAME \\\n--currency=$CURRENCY --timezone=$TIMEZONE --use-rewrites=1\n\n# setup whitelisted IP for maintenance mode\nMYIP=$(last -i | grep \"still logged in\" | awk '{print $3}' | uniq)\nphp $WEBROOT/bin/magento maintenance:allow-ips $MYIP\n\n# fix base-url if mistakes occur\nphp $WEBROOT/bin/magento setup:store-config:set --base-url=\"https://${vhostname}/\"\nphp $WEBROOT/bin/magento setup:store-config:set --base-url-secure=\"https://${vhostname}/\"\nphp $WEBROOT/bin/magento setup:store-config:set --use-secure=1\nphp $WEBROOT/bin/magento setup:store-config:set --use-secure-admin=1\nphp $WEBROOT/bin/magento cache:flush\n\n# list database tables\necho \"SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name', CONCAT(ROUND(table_rows,2),' Rows') AS 'Number of Rows',ENGINE AS 'Storage Engine',CONCAT(ROUND(data_length/(1024*1024),2),'MB') AS 'Data Size',\nCONCAT(ROUND(index_length/(1024*1024),2),'MB') AS 'Index Size' ,CONCAT(ROUND((data_length+index_length)/(1024*1024),2),'MB') AS'Total', ROW_FORMAT, TABLE_COLLATION FROM information_schema.TABLES WHERE table_schema LIKE '$DBNAME';\" | mysql -t\n\n# mysql engine breakdown stats\necho \"SELECT engine, count(*) tables, concat(round(sum(table_rows))) rows, concat(round(sum(data_length)/(1024*1024),2),'MB') data, concat(round(sum(index_length)/(1024*1024),2),'MB') idx, concat(round(sum(data_length+index_length)/(1024*1024),2),'MB') total_size, round(sum(index_length)/sum(data_length),2) idxfrac FROM information_schema.TABLES WHERE table_schema LIKE '$DBNAME' GROUP BY engine ORDER BY sum(data_length+index_length) DESC LIMIT 10;\" | mysql -t\n\n# setup default, full page and session based redis caching in redis databases 12, 13 and 14 respectively instead of default\n# if using redis unix socket set to \n# redisserver='/var/run/redis/redis.sock'\nredisserver=127.0.0.1\n# lz4 or gzip\ncompresstype=lz4\nport=6379\nphp $WEBROOT/bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=$redisserver --cache-backend-redis-db=12 --cache-backend-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=$redisserver --page-cache-redis-db=13 --page-cache-redis-compress-data=$compresstype --page-cache-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:config:set --session-save=redis --session-save-redis-host=$redisserver --session-save-redis-log-level=3 --session-save-redis-db=14 --session-save-redis-compression-lib=$compresstype --session-save-redis-max-concurrency=4 --session-save-redis-first-lifetime=600 --session-save-redis-bot-first-lifetime=60 --session-save-redis-bot-lifetime=7200 --session-save-redis-min-lifetime=60 --session-save-redis-max-lifetime=2592000 --session-save-redis-break-after-frontend=60 --session-save-redis-break-after-adminhtml=60 --session-save-redis-port=$port\n\n#n98-magerun2 config:set catalog/frontend/grid_per_page_values \"12,24,36\"\n#n98-magerun2 config:set catalog/frontend/grid_per_page \"12\"\nn98-magerun2 config:set catalog/frontend/flat_catalog_category 1\nn98-magerun2 config:set catalog/frontend/flat_catalog_product 1\nn98-magerun2 config:set system/full_page_cache/caching_application 1\nn98-magerun2 config:set system/full_page_cache/ttl 86400\nn98-magerun2 config:set dev/grid/async_indexing 1\nn98-magerun2 config:set sales_email/general/async_sending 1\n\nphp $WEBROOT/bin/magento cache:status\nphp $WEBROOT/bin/magento cache:flush\nphp $WEBROOT/bin/magento indexer:reindex cataloginventory_stock\nphp $WEBROOT/bin/magento indexer:reindex\nphp $WEBROOT/bin/magento cache:enable\n\n# cronjob setup\ncrontab -l \u003e cronjob.backups\nls -lah cronjob.backups\nphp $WEBROOT/bin/magento cron:install\ncrontab -l \u003e cronjob.magento\nsed -i 's|#~ MAGENTO START|\\n#~ MAGENTO START|' cronjob.magento\ncrontab cronjob.magento\ncrontab -l\n\n# set umask http://devdocs.magento.com/guides/v2.2/install-gde/install/post-install-umask.html\necho \"022\" \u003e $WEBROOT/magento_umask\n\n# optimisations for production mode only\nphp $WEBROOT/bin/magento deploy:mode:show\nphp $WEBROOT/bin/magento deploy:mode:set production\n# optimisations\nn98-magerun2 config:set dev/js/merge_files 1\nn98-magerun2 config:set dev/css/merge_css_files 1\nphp $WEBROOT/bin/magento indexer:set-mode schedule design_config_grid customer_grid catalog_product_flat catalog_category_flat catalog_category_product catalog_product_category catalog_product_price catalog_product_attribute cataloginventory_stock catalogrule_rule catalogrule_product catalogsearch_fulltext\nphp $WEBROOT/bin/magento module:disable Shopial_Facebook\nphp $WEBROOT/bin/magento setup:static-content:deploy\nphp $WEBROOT/bin/magento setup:di:compile\n\necho \"admin url = https://${vhostname}/${BACKEND_FRONTNAME}\"\n```\n\nOptional install [Peformance Dashboard Extension](https://github.com/magehost/performance-dashboard)\n\n```\ncomposer require magehost/performance-dashboard\nphp $WEBROOT/bin/magento module:enable MageHost_PerformanceDashboard\nphp $WEBROOT/bin/magento setup:upgrade\nphp $WEBROOT/bin/magento setup:di:compile\nphp $WEBROOT/bin/magento setup:static-content:deploy --area adminhtml\ncomposer dump-autoload -o\nchown -R nginx:nginx \"/home/nginx/domains/${vhostname}/public\"\n```\n\n\nYou can also install [Magento 2 sample data](https://github.com/centminmod/centminmod-magento2#magento-2-install-and-remove-sample-data) but you need to switch to `developer` mode first to install the sample data. Don't install sample data if you intend to run a production live web site.\n\n#### Magento 2 logrotate configuration\n\nConfiguring logrotate for Magento 2 by setting up a `/etc/logrotate.d/magento2` logrotate config file with following contents\n\n```\n/home/nginx/domains/magento.domain.com/public/var/log/*.log {\n  su root root\n  size 10M\n  missingok\n  rotate 50\n  compress\n  delaycompress\n  notifempty\n  dateext\n}\n```\n\nManually test logrotate\n\n```\nlogrotate -df /etc/logrotate.d/magento2\n```\n\n### Step 4. Nginx Vhost \n\nAs per https://community.centminmod.com/threads/updated-magento-2-nginx-directives-for-magento-2-15.10975/ with adjusted modifications derived from the reading of other info links.\n\nIn `/usr/local/nginx/conf/nginx.conf` add within `http {`content add a HSTS header map\n\n```\nhttp {\n\n## Map HSTS header\nmap $scheme $mag_hstsheader { https  \"max-age=31556926; includeSubDomains\"; }\n```\n\n* Make a copy of `/usr/local/nginx/conf/php.conf` named as `/usr/local/nginx/conf/php_magento.conf` and then disable and comment out with hash in front of `fastcgi_split_path_info` directive in `/usr/local/nginx/conf/php_magento.conf.\n* Make a copy of Centmin Mod Nginx HTTP/2 HTTPS vhost config file `/usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf ` named as `/usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf.original`\n* Disable via renaming the Centmin Mod Nginx non-HTTPS vhost config file `/usr/local/nginx/conf/conf.d/magento.domain.com.conf` renamed as `/usr/local/nginx/conf/conf.d/magento.domain.com.conf.disabled`\n\n```\ncp -a /usr/local/nginx/conf/php.conf /usr/local/nginx/conf/php_magento.conf\nsed -i 's|fastcgi_split_path_info|#fastcgi_split_path_info|' /usr/local/nginx/conf/php_magento.conf\ncp -a /usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf /usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf.original\nmv /usr/local/nginx/conf/conf.d/magento.domain.com.conf /usr/local/nginx/conf/conf.d/magento.domain.com.conf.disabled\n```\nEdit Centmin Mod HTTP/2 HTTPS Nginx vhost config file `/usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf` and force HTTP to HTTPS redirect by uncommenting the 5 lines for `return 302` redirect using nano linux text editor\n```\nnano /usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf\n```\nEnable 302 redirect of non-HTTPS requests to HTTPS version of site domain\n```\n# Centmin Mod Getting Started Guide\n# must read http://centminmod.com/getstarted.html\n# For HTTP/2 SSL Setup\n# read http://centminmod.com/nginx_configure_https_ssl_spdy.html\n\n# redirect from www to non-www  forced SSL\n# uncomment, save file and restart Nginx to enable\n# if unsure use return 302 before using return 301\n server {\n       listen   80;\n       server_name magento.domain.com www.magento.domain.com;\n       return 302 https://$server_name$request_uri;\n }\n\n```\nBelow is the just the Magento 2.2.2 related Nginx rules to be placed in `/usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf` Nginx vhost config file.\n```\nset $MAGE_ROOT /home/nginx/domains/magento.domain.com/public;\nroot $MAGE_ROOT/pub;\ninclude /usr/local/nginx/conf/503include-main.conf;\n\nindex index.php;\nautoindex off;\ncharset UTF-8;\nerror_page 404 403 = /errors/404.php;\n#add_header \"X-UA-Compatible\" \"IE=Edge\";\n\n# PHP entry point for setup application\nlocation ~* ^/setup($|/) {\n    root $MAGE_ROOT;\n    location ~ ^/setup/index.php {\n        include /usr/local/nginx/conf/php.conf;\n    }\n\n    location ~ ^/setup/(?!pub/). {\n        deny all;\n    }\n\n    location ~ ^/setup/pub/ {\n        add_header X-Frame-Options \"SAMEORIGIN\";\n    }\n}\n\n# PHP entry point for update application\nlocation ~* ^/update($|/) {\n    root $MAGE_ROOT;\n\n    location ~ ^/update/index.php {\n        fastcgi_split_path_info ^(/update/index.php)(/.+)$;\n        include /usr/local/nginx/conf/php_magento.conf;\n    }\n\n    # Deny everything but index.php\n    location ~ ^/update/(?!pub/). {\n        deny all;\n    }\n\n    location ~ ^/update/pub/ {\n        add_header X-Frame-Options \"SAMEORIGIN\";\n    }\n}\n\nlocation / {\n    include /usr/local/nginx/conf/503include-only.conf;\n    try_files $uri $uri/ /index.php$is_args$args;\n}\n\nlocation /pub/ {\n    location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\\.xml) {\n        deny all;\n    }\n    alias $MAGE_ROOT/pub/;\n    add_header X-Frame-Options \"SAMEORIGIN\";\n}\n\nlocation /static/ {\n    # Uncomment the following line in production mode\n    expires max;\n\n    # Remove signature of the static files that is used to overcome the browser cache\n    location ~ ^/static/version {\n        rewrite ^/static/(version\\d*/)?(.*)$ /static/$2 last;\n    }\n    location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires 30d;\n\n        if (!-f $request_filename) {\n            rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n        }\n    }\n    location ~* \\.(swf|eot|ttf|otf|woff|woff2)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires +1y;\n\n        if (!-f $request_filename) {\n            rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n        }\n    }\n    location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {\n        add_header Cache-Control \"no-store\";\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires    off;\n\n        if (!-f $request_filename) {\n           rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n        }\n    }\n    if (!-f $request_filename) {\n        rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n    }\n    add_header X-Frame-Options \"SAMEORIGIN\";\n}\n\nlocation /media/ {\n    try_files $uri $uri/ /get.php$is_args$args;\n\n    location ~ ^/media/theme_customization/.*\\.xml {\n        deny all;\n    }\n    location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires 30d;\n        try_files $uri $uri/ /get.php$is_args$args;\n    }\n    location ~* \\.(swf|eot|ttf|otf|woff|woff2)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires +1y;\n        try_files $uri $uri/ /get.php$is_args$args;\n    }\n    location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {\n        add_header Cache-Control \"no-store\";\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires    off;\n        try_files $uri $uri/ /get.php$is_args$args;\n    }\n    add_header X-Frame-Options \"SAMEORIGIN\";\n}\n\nlocation /media/customer/ {\n    deny all;\n}\n\nlocation /media/downloadable/ {\n    deny all;\n}\n\nlocation /media/import/ {\n    deny all;\n}\n\n# Deny cron and files with the obvious names. favorite entry points for hackers and script kiddie\nlocation ~* ^/(cron|phpminiadmin|pma|sqlyog|adminer.+)\\.php { deny all; }\n\n# Deny auth and composer\nlocation ~ (auth|package|composer)\\.(json|lock)$ { deny all; }\n\n# PHP entry point for main application\nlocation ~ (index|get|static|report|404|503|health_check)\\.php$ {\n    try_files $uri =404;\n    add_header X-Processing-Time $request_time always;\n    add_header X-Request-ID $request_id always;\n    add_header Strict-Transport-Security $mag_hstsheader always;\n    add_header X-UA-Compatible 'IE=Edge,chrome=1';\n    add_header Link \"\u003c$scheme://$http_host$request_uri\u003e; rel=\\\"canonical\\\"\" always;\n    fastcgi_buffers 1024 4k;\n\n    fastcgi_param  PHP_FLAG  \"session.auto_start=off \\n suhosin.session.cryptua=off\";\n    fastcgi_param  PHP_VALUE \"memory_limit=4096M \\n max_execution_time=18000 \\n max_input_time=18000\";\n    fastcgi_read_timeout 600s;\n    fastcgi_connect_timeout 600s;\n    include /usr/local/nginx/conf/503include-only.conf;\n    include /usr/local/nginx/conf/php.conf;\n}\n\n# Banned locations (only reached if the earlier PHP entry point regexes don't match)\nlocation ~* (\\.php$|\\.htaccess$|\\.git) {\n    deny all;\n}\n\n  include /usr/local/nginx/conf/pre-staticfiles-local-magento.domain.com.conf;\n  include /usr/local/nginx/conf/pre-staticfiles-global.conf;\n  #include /usr/local/nginx/conf/staticfiles.conf;\n  #include /usr/local/nginx/conf/php.conf;\n  #include /usr/local/nginx/conf/drop.conf;\n  #include /usr/local/nginx/conf/errorpage.conf;\n  include /usr/local/nginx/conf/vts_server.conf;\n```\n\nThe resulting full Centmin Mod Nginx HTTP/2 HTTPS based Magento 2.2.2 vhost config file `/usr/local/nginx/conf/conf.d/magento.domain.com.ssl.conf` for self-signed SSL certificate based site example is below:\n\n```\n# Centmin Mod Getting Started Guide\n# must read http://centminmod.com/getstarted.html\n# For HTTP/2 SSL Setup\n# read http://centminmod.com/nginx_configure_https_ssl_spdy.html\n\n# redirect from www to non-www  forced SSL\n# uncomment, save file and restart Nginx to enable\n# if unsure use return 302 before using return 301\n server {\n       listen   80;\n       server_name magento.domain.com www.magento.domain.com;\n       return 302 https://$server_name$request_uri;\n }\n\nserver {\n  listen 443 ssl http2;\n  server_name magento.domain.com www.magento.domain.com;\n\n  ssl_dhparam /usr/local/nginx/conf/ssl/magento.domain.com/dhparam.pem;\n  ssl_certificate      /usr/local/nginx/conf/ssl/magento.domain.com/magento.domain.com.crt;\n  ssl_certificate_key  /usr/local/nginx/conf/ssl/magento.domain.com/magento.domain.com.key;\n  include /usr/local/nginx/conf/ssl_include.conf;\n\n  # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/\n  #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/magento.domain.com/origin.crt;\n  #ssl_verify_client on;\n  http2_max_field_size 16k;\n  http2_max_header_size 32k;\n  # mozilla recommended\n  ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;\n  ssl_prefer_server_ciphers   on;\n  #add_header Alternate-Protocol  443:npn-spdy/3;\n\n  # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts\n  #add_header Strict-Transport-Security \"max-age=31536000; includeSubdomains;\";\n  #add_header X-Frame-Options SAMEORIGIN;\n  #add_header X-Xss-Protection \"1; mode=block\" always;\n  #add_header X-Content-Type-Options \"nosniff\" always;\n  #add_header Referrer-Policy \"strict-origin-when-cross-origin\";\n  #spdy_headers_comp 5;\n  ssl_buffer_size 1369;\n  ssl_session_tickets on;\n  \n  # enable ocsp stapling\n  #resolver 8.8.8.8 8.8.4.4 valid=10m;\n  #resolver_timeout 10s;\n  #ssl_stapling on;\n  #ssl_stapling_verify on;\n  #ssl_trusted_certificate /usr/local/nginx/conf/ssl/magento.domain.com/magento.domain.com-trusted.crt;  \n\n# ngx_pagespeed \u0026 ngx_pagespeed handler\n#include /usr/local/nginx/conf/pagespeed.conf;\n#include /usr/local/nginx/conf/pagespeedhandler.conf;\n#include /usr/local/nginx/conf/pagespeedstatslog.conf;\n\n  # limit_conn limit_per_ip 16;\n  # ssi  on;\n\n  access_log /home/nginx/domains/magento.domain.com/log/access.log combined buffer=256k flush=5m;\n  error_log /home/nginx/domains/magento.domain.com/log/error.log;\n\n  #include /usr/local/nginx/conf/autoprotect/magento.domain.com/autoprotect-magento.domain.com.conf;\nset $MAGE_ROOT /home/nginx/domains/magento.domain.com/public;\nroot $MAGE_ROOT/pub;\ninclude /usr/local/nginx/conf/503include-main.conf;\n\nindex index.php;\nautoindex off;\ncharset UTF-8;\nerror_page 404 403 = /errors/404.php;\n#add_header \"X-UA-Compatible\" \"IE=Edge\";\n\n# PHP entry point for setup application\nlocation ~* ^/setup($|/) {\n    root $MAGE_ROOT;\n    location ~ ^/setup/index.php {\n        include /usr/local/nginx/conf/php.conf;\n    }\n\n    location ~ ^/setup/(?!pub/). {\n        deny all;\n    }\n\n    location ~ ^/setup/pub/ {\n        add_header X-Frame-Options \"SAMEORIGIN\";\n    }\n}\n\n# PHP entry point for update application\nlocation ~* ^/update($|/) {\n    root $MAGE_ROOT;\n\n    location ~ ^/update/index.php {\n        fastcgi_split_path_info ^(/update/index.php)(/.+)$;\n        include /usr/local/nginx/conf/php_magento.conf;\n    }\n\n    # Deny everything but index.php\n    location ~ ^/update/(?!pub/). {\n        deny all;\n    }\n\n    location ~ ^/update/pub/ {\n        add_header X-Frame-Options \"SAMEORIGIN\";\n    }\n}\n\nlocation / {\n    include /usr/local/nginx/conf/503include-only.conf;\n    try_files $uri $uri/ /index.php$is_args$args;\n}\n\nlocation /pub/ {\n    location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\\.xml) {\n        deny all;\n    }\n    alias $MAGE_ROOT/pub/;\n    add_header X-Frame-Options \"SAMEORIGIN\";\n}\n\nlocation /static/ {\n    # Uncomment the following line in production mode\n    expires max;\n\n    # Remove signature of the static files that is used to overcome the browser cache\n    location ~ ^/static/version {\n        rewrite ^/static/(version\\d*/)?(.*)$ /static/$2 last;\n    }\n    location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires 30d;\n\n        if (!-f $request_filename) {\n            rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n        }\n    }\n    location ~* \\.(swf|eot|ttf|otf|woff|woff2)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires +1y;\n\n        if (!-f $request_filename) {\n            rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n        }\n    }\n    location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {\n        add_header Cache-Control \"no-store\";\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires    off;\n\n        if (!-f $request_filename) {\n           rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n        }\n    }\n    if (!-f $request_filename) {\n        rewrite ^/static/?(.*)$ /static.php?resource=$1 last;\n    }\n    add_header X-Frame-Options \"SAMEORIGIN\";\n}\n\nlocation /media/ {\n    try_files $uri $uri/ /get.php$is_args$args;\n\n    location ~ ^/media/theme_customization/.*\\.xml {\n        deny all;\n    }\n    location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires 30d;\n        try_files $uri $uri/ /get.php$is_args$args;\n    }\n    location ~* \\.(swf|eot|ttf|otf|woff|woff2)$ {\n        add_header Cache-Control \"public\";\n        add_header Access-Control-Allow-Origin *;\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires +1y;\n        try_files $uri $uri/ /get.php$is_args$args;\n    }\n    location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {\n        add_header Cache-Control \"no-store\";\n        add_header X-Frame-Options \"SAMEORIGIN\";\n        expires    off;\n        try_files $uri $uri/ /get.php$is_args$args;\n    }\n    add_header X-Frame-Options \"SAMEORIGIN\";\n}\n\nlocation /media/customer/ {\n    deny all;\n}\n\nlocation /media/downloadable/ {\n    deny all;\n}\n\nlocation /media/import/ {\n    deny all;\n}\n\n# Deny cron and files with the obvious names. favorite entry points for hackers and script kiddie\nlocation ~* ^/(cron|phpminiadmin|pma|sqlyog|adminer.+)\\.php { deny all; }\n\n# Deny auth and composer\nlocation ~ (auth|package|composer)\\.(json|lock)$ { deny all; }\n\n# PHP entry point for main application\nlocation ~ (index|get|static|report|404|503|health_check)\\.php$ {\n    try_files $uri =404;\n    add_header X-Processing-Time $request_time always;\n    add_header X-Request-ID $request_id always;\n    add_header Strict-Transport-Security $mag_hstsheader always;\n    add_header X-UA-Compatible 'IE=Edge,chrome=1';\n    add_header Link \"\u003c$scheme://$http_host$request_uri\u003e; rel=\\\"canonical\\\"\" always;\n    fastcgi_buffers 1024 4k;\n\n    fastcgi_param  PHP_FLAG  \"session.auto_start=off \\n suhosin.session.cryptua=off\";\n    fastcgi_param  PHP_VALUE \"memory_limit=4096M \\n max_execution_time=18000 \\n max_input_time=18000\";\n    fastcgi_read_timeout 600s;\n    fastcgi_connect_timeout 600s;\n    include /usr/local/nginx/conf/503include-only.conf;\n    include /usr/local/nginx/conf/php.conf;\n}\n\n# Banned locations (only reached if the earlier PHP entry point regexes don't match)\nlocation ~* (\\.php$|\\.htaccess$|\\.git) {\n    deny all;\n}\n\n  include /usr/local/nginx/conf/pre-staticfiles-local-magento.domain.com.conf;\n  include /usr/local/nginx/conf/pre-staticfiles-global.conf;\n  #include /usr/local/nginx/conf/staticfiles.conf;\n  #include /usr/local/nginx/conf/php.conf;\n  #include /usr/local/nginx/conf/drop.conf;\n  #include /usr/local/nginx/conf/errorpage.conf;\n  include /usr/local/nginx/conf/vts_server.conf;\n}\n```\n\nEnd result is Centmin Mod Nginx 1.13 HTTP/2 HTTPS based Magento 2.2.2 installation\n\nsystem info\n\n```\nn98-magerun2 sys:info --skip-root-check\n\n                              \n  Magento System Information  \n                              \n\n+------------------+-----------------------------------------------+\n| name             | value                                         |\n+------------------+-----------------------------------------------+\n| Name             | Magento                                       |\n| Version          | 2.2.2                                         |\n| Edition          | Community                                     |\n| Root             | /home/nginx/domains/magento.domain.com/public |\n| Application Mode | production                                    |\n| Session          | redis                                         |\n| Crypt Key        | d45f000b87ce82******************              |\n| Install Date     | Sun, 11 Mar 2018 20:40:12 +0000               |\n| Cache Backend    | Cm_Cache_Backend_Redis                        |\n| Vendors          | Magento, Dotdigitalgroup, Shopial, Temando    |\n| Attribute Count  | 134                                           |\n| Customer Count   | 0                                             |\n| Category Count   | 2                                             |\n| Product Count    | 0                                             |\n+------------------+-----------------------------------------------+\n```\n\ncache list\n\n```\nn98-magerun2 cache:list --skip-root-check\n\n                       \n  Magento Cache Types  \n                       \n\n+------------------------+--------------------------------+---------+\n| Name                   | Type                           | Enabled |\n+------------------------+--------------------------------+---------+\n| config                 | Configuration                  | 1       |\n| layout                 | Layouts                        | 1       |\n| block_html             | Blocks HTML output             | 1       |\n| collections            | Collections Data               | 1       |\n| reflection             | Reflection Data                | 1       |\n| db_ddl                 | Database DDL operations        | 1       |\n| eav                    | EAV types and attributes       | 1       |\n| customer_notification  | Customer Notification          | 1       |\n| config_integration     | Integrations Configuration     | 1       |\n| config_integration_api | Integrations API Configuration | 1       |\n| full_page              | Page Cache                     | 1       |\n| translate              | Translations                   | 1       |\n| config_webservice      | Web Services Configuration     | 1       |\n+------------------------+--------------------------------+---------+\n```\n\nsystem check\n\n```\nn98-magerun2 sys:check --skip-root-check\n\n                                                                \n                            SETTINGS                            \n                                                                \n\n✔ Secure BaseURL: https://magento.domain.com/ of Store: default - OK\n✔ Unsecure BaseURL: https://magento.domain.com/ of Store: default - OK\n✔ Empty cookie Domain (secure) of Store: default - OK\n✔ Empty cookie Domain (unsecure) of Store: default - OK\n\n                                                                \n                           FILESYSTEM                           \n                                                                \n\n✔ Folder pub/media found.\n✔ Folder var found.\n✖ Folder var/cache not found! Usage: Used for caching\n✔ Folder var/session found.\n✔ File app/etc/env.php found.\n\n                                                                \n                              PHP                               \n                                                                \n\n✔ Required PHP Module simplexml found.\n✔ Required PHP Module mcrypt found.\n✔ Required PHP Module hash found.\n✔ Required PHP Module gd found.\n✔ Required PHP Module dom found.\n✔ Required PHP Module iconv found.\n✔ Required PHP Module curl found.\n✔ Required PHP Module soap found.\n✔ Required PHP Module pdo found.\n✔ Required PHP Module pdo_mysql found.\n✔ Required PHP Module intl found.\n✔ Required PHP Module openssl found.\n✔ Bytecode Cache Zend OPcache found.\n\n                                                                \n                             MYSQL                              \n                                                                \n\n✔ MySQL Version 10.1.31-MariaDB found.\n✔ Required MySQL Storage Engine InnoDB found.\n```\n\ndatabase info\n\n```\nn98-magerun2 db:info --skip-root-check  \n+------------------------+----------------------------------------------------------------------------------------------------+\n| Name                   | Value                                                                                              |\n+------------------------+----------------------------------------------------------------------------------------------------+\n| host                   | localhost                                                                                          |\n| dbname                 | magento2*****                                                                                      |\n| username               | magento2a6********                                                                                 |\n| password               | jIPa748zeZ***********                                                                              |\n| model                  | mysql4                                                                                             |\n| engine                 | innodb                                                                                             |\n| initStatements         | SET NAMES utf8;                                                                                    |\n| active                 | 1                                                                                                  |\n| prefix                 | mags_                                                                                              |\n| PDO-Connection-String  | mysql:host=localhost;port=3306;dbname=magento2****                                                 |\n| JDBC-Connection-String | jdbc:mysql://localhost:3306/magento2****?username=magento2a6*******\u0026password=jjIPa748zeZ********** |\n| MySQL-Cli-String       | mysql -h'localhost' -u'magento2a6*******' --password='jjIPa748zeZ**********' 'magento2****'        |\n+------------------------+----------------------------------------------------------------------------------------------------+\n```\n\ndatabase server status\n\n```\nn98-magerun2 db:status --skip-root-check\n+--------------------------------+--------------+-----------------------------------------------------------------------------+\n| Variable Name                  | Value        | Description                                                                 |\n+--------------------------------+--------------+-----------------------------------------------------------------------------+\n| Aborted_connects               |            0 | Total number of failed attempts to connect to MySQL.                        |\n| Created_tmp_disk_tables        |          406 | Number of temporary tables that have been created on disk instead of        |\n|                                |              | in-memory. Lower is better.                                                 |\n| Handler_read_first             |         6422 | Number of times a table handler made a request to read the first row of a   |\n|                                |              | table index.                                                                |\n| Handler_read_rnd_next          |      7280977 | Number of requests to read the next row in the data file. This value is     |\n|                                |              | high if you are doing a lot of table scans. Generally this suggests that    |\n|                                |              | your tables are not properly indexed or that your queries are not written   |\n|                                |              | to take advantage of the indexes you have.                                  |\n| Innodb_buffer_pool_pages_dirty |            0 | Indicates the number of InnoDB buffer pool data pages that have been        |\n|                                |              | changed in memory, but the changes are not yet written (flushed) to the     |\n|                                |              | InnoDB data files                                                           |\n| Innodb_buffer_pool_wait_free   |            0 | Number of times MySQL has to wait for memory pages to be flushed.           |\n| Key_reads                      |            9 | Number of filesystem accesses MySQL performed to fetch database indexes.    |\n| Max_used_connections           |           12 | Max number of connections MySQL has had open at the same time since the     |\n|                                |              | server was last restarted.                                                  |\n| Open_tables                    |          398 | Number of tables that are currently open.                                   |\n| Select_full_join               |           11 | Number of full joins MySQL has performed to satisfy client queries.         |\n| Slow_queries                   |            0 | Number of queries that have taken longer than usual to execute.             |\n| Threads_connected              |            1 | Total number of clients that have currently open connections to the server. |\n| Uptime                         | 19 hours ago | Time since the server was last restarted.                                   |\n| Full table scans               | 69.86%       | HINT: \"Handler_read_rnd_next\" is reset to zero when reached the value of    |\n|                                |              | 2^32 (4G).                                                                  |\n| InnoDB Buffer Pool hit         | 100.00%      | An InnoDB Buffer Pool hit ratio below 99.9% is a weak indicator that your   |\n|                                |              | InnoDB Buffer Pool could be increased.                                      |\n+--------------------------------+--------------+-----------------------------------------------------------------------------+\n```\n\nMariaDB server variables of note\n\n```\nn98-magerun2 db:variables --skip-root-check\n+---------------------------------+--------+\n| Variable Name                   | Value  |\n+---------------------------------+--------+\n| have_query_cache                |    YES |\n| innodb_additional_mem_pool_size |     8M |\n| innodb_buffer_pool_size         |   192M |\n| innodb_log_buffer_size          |     8M |\n| innodb_log_file_size            |   128M |\n| innodb_thread_concurrency       |      0 |\n| join_buffer_size                |   128K |\n| key_buffer_size                 |    32M |\n| max_allowed_packet              |    64M |\n| max_connections                 |    300 |\n| max_heap_table_size             |   128M |\n| open_files_limit                | 524288 |\n| query_cache_size                |    64M |\n| query_cache_type                |     ON |\n| read_buffer_size                |   128K |\n| read_rnd_buffer_size            |   256K |\n| sort_buffer_size                |   256K |\n| table_definition_cache          |   8192 |\n| table_open_cache                |   4096 |\n| thread_cache_size               |   128B |\n| tmp_table_size                  |   128M |\n+---------------------------------+--------+\n```\n\nShow Magento 2 database tables\n\n```\nn98-magerun2 db:query \"show tables;\" --skip-root-check   \nTables_in_magento24MUU\nmags_admin_passwords\nmags_admin_system_messages\nmags_admin_user\nmags_admin_user_session\nmags_adminnotification_inbox\nmags_authorization_role\nmags_authorization_rule\nmags_cache\nmags_cache_tag\nmags_captcha_log\nmags_catalog_category_entity\nmags_catalog_category_entity_datetime\nmags_catalog_category_entity_decimal\nmags_catalog_category_entity_int\nmags_catalog_category_entity_text\nmags_catalog_category_entity_varchar\nmags_catalog_category_flat_cl\nmags_catalog_category_flat_store_1\nmags_catalog_category_product\nmags_catalog_category_product_cl\nmags_catalog_category_product_index\nmags_catalog_category_product_index_replica\nmags_catalog_category_product_index_tmp\nmags_catalog_compare_item\nmags_catalog_eav_attribute\nmags_catalog_product_attribute_cl\nmags_catalog_product_bundle_option\nmags_catalog_product_bundle_option_value\nmags_catalog_product_bundle_price_index\nmags_catalog_product_bundle_selection\nmags_catalog_product_bundle_selection_price\nmags_catalog_product_bundle_stock_index\nmags_catalog_product_category_cl\nmags_catalog_product_entity\nmags_catalog_product_entity_datetime\nmags_catalog_product_entity_decimal\nmags_catalog_product_entity_gallery\nmags_catalog_product_entity_int\nmags_catalog_product_entity_media_gallery\nmags_catalog_product_entity_media_gallery_value\nmags_catalog_product_entity_media_gallery_value_to_entity\nmags_catalog_product_entity_media_gallery_value_video\nmags_catalog_product_entity_text\nmags_catalog_product_entity_tier_price\nmags_catalog_product_entity_varchar\nmags_catalog_product_flat_1\nmags_catalog_product_flat_cl\nmags_catalog_product_frontend_action\nmags_catalog_product_index_eav\nmags_catalog_product_index_eav_decimal\nmags_catalog_product_index_eav_decimal_idx\nmags_catalog_product_index_eav_decimal_replica\nmags_catalog_product_index_eav_decimal_tmp\nmags_catalog_product_index_eav_idx\nmags_catalog_product_index_eav_replica\nmags_catalog_product_index_eav_tmp\nmags_catalog_product_index_price\nmags_catalog_product_index_price_bundle_idx\nmags_catalog_product_index_price_bundle_opt_idx\nmags_catalog_product_index_price_bundle_opt_tmp\nmags_catalog_product_index_price_bundle_sel_idx\nmags_catalog_product_index_price_bundle_sel_tmp\nmags_catalog_product_index_price_bundle_tmp\nmags_catalog_product_index_price_cfg_opt_agr_idx\nmags_catalog_product_index_price_cfg_opt_agr_tmp\nmags_catalog_product_index_price_cfg_opt_idx\nmags_catalog_product_index_price_cfg_opt_tmp\nmags_catalog_product_index_price_downlod_idx\nmags_catalog_product_index_price_downlod_tmp\nmags_catalog_product_index_price_final_idx\nmags_catalog_product_index_price_final_tmp\nmags_catalog_product_index_price_idx\nmags_catalog_product_index_price_opt_agr_idx\nmags_catalog_product_index_price_opt_agr_tmp\nmags_catalog_product_index_price_opt_idx\nmags_catalog_product_index_price_opt_tmp\nmags_catalog_product_index_price_replica\nmags_catalog_product_index_price_tmp\nmags_catalog_product_index_tier_price\nmags_catalog_product_index_website\nmags_catalog_product_link\nmags_catalog_product_link_attribute\nmags_catalog_product_link_attribute_decimal\nmags_catalog_product_link_attribute_int\nmags_catalog_product_link_attribute_varchar\nmags_catalog_product_link_type\nmags_catalog_product_option\nmags_catalog_product_option_price\nmags_catalog_product_option_title\nmags_catalog_product_option_type_price\nmags_catalog_product_option_type_title\nmags_catalog_product_option_type_value\nmags_catalog_product_price_cl\nmags_catalog_product_relation\nmags_catalog_product_super_attribute\nmags_catalog_product_super_attribute_label\nmags_catalog_product_super_link\nmags_catalog_product_website\nmags_catalog_url_rewrite_product_category\nmags_cataloginventory_stock\nmags_cataloginventory_stock_cl\nmags_cataloginventory_stock_item\nmags_cataloginventory_stock_status\nmags_cataloginventory_stock_status_idx\nmags_cataloginventory_stock_status_replica\nmags_cataloginventory_stock_status_tmp\nmags_catalogrule\nmags_catalogrule_customer_group\nmags_catalogrule_group_website\nmags_catalogrule_group_website_replica\nmags_catalogrule_product\nmags_catalogrule_product_cl\nmags_catalogrule_product_price\nmags_catalogrule_product_price_replica\nmags_catalogrule_product_replica\nmags_catalogrule_rule_cl\nmags_catalogrule_website\nmags_catalogsearch_fulltext_cl\nmags_catalogsearch_fulltext_scope1\nmags_checkout_agreement\nmags_checkout_agreement_store\nmags_cms_block\nmags_cms_block_store\nmags_cms_page\nmags_cms_page_store\nmags_core_config_data\nmags_cron_schedule\nmags_customer_address_entity\nmags_customer_address_entity_datetime\nmags_customer_address_entity_decimal\nmags_customer_address_entity_int\nmags_customer_address_entity_text\nmags_customer_address_entity_varchar\nmags_customer_dummy_cl\nmags_customer_eav_attribute\nmags_customer_eav_attribute_website\nmags_customer_entity\nmags_customer_entity_datetime\nmags_customer_entity_decimal\nmags_customer_entity_int\nmags_customer_entity_text\nmags_customer_entity_varchar\nmags_customer_form_attribute\nmags_customer_grid_flat\nmags_customer_group\nmags_customer_log\nmags_customer_visitor\nmags_design_change\nmags_design_config_dummy_cl\nmags_design_config_grid_flat\nmags_directory_country\nmags_directory_country_format\nmags_directory_country_region\nmags_directory_country_region_name\nmags_directory_currency_rate\nmags_downloadable_link\nmags_downloadable_link_price\nmags_downloadable_link_purchased\nmags_downloadable_link_purchased_item\nmags_downloadable_link_title\nmags_downloadable_sample\nmags_downloadable_sample_title\nmags_eav_attribute\nmags_eav_attribute_group\nmags_eav_attribute_label\nmags_eav_attribute_option\nmags_eav_attribute_option_swatch\nmags_eav_attribute_option_value\nmags_eav_attribute_set\nmags_eav_entity\nmags_eav_entity_attribute\nmags_eav_entity_datetime\nmags_eav_entity_decimal\nmags_eav_entity_int\nmags_eav_entity_store\nmags_eav_entity_text\nmags_eav_entity_type\nmags_eav_entity_varchar\nmags_eav_form_element\nmags_eav_form_fieldset\nmags_eav_form_fieldset_label\nmags_eav_form_type\nmags_eav_form_type_entity\nmags_email_automation\nmags_email_campaign\nmags_email_catalog\nmags_email_contact\nmags_email_importer\nmags_email_order\nmags_email_review\nmags_email_rules\nmags_email_template\nmags_email_wishlist\nmags_flag\nmags_gift_message\nmags_googleoptimizer_code\nmags_import_history\nmags_importexport_importdata\nmags_indexer_state\nmags_integration\nmags_layout_link\nmags_layout_update\nmags_mview_state\nmags_newsletter_problem\nmags_newsletter_queue\nmags_newsletter_queue_link\nmags_newsletter_queue_store_link\nmags_newsletter_subscriber\nmags_newsletter_template\nmags_oauth_consumer\nmags_oauth_nonce\nmags_oauth_token\nmags_oauth_token_request_log\nmags_password_reset_request_event\nmags_paypal_billing_agreement\nmags_paypal_billing_agreement_order\nmags_paypal_cert\nmags_paypal_payment_transaction\nmags_paypal_settlement_report\nmags_paypal_settlement_report_row\nmags_persistent_session\nmags_product_alert_price\nmags_product_alert_stock\nmags_quote\nmags_quote_address\nmags_quote_address_item\nmags_quote_id_mask\nmags_quote_item\nmags_quote_item_option\nmags_quote_payment\nmags_quote_shipping_rate\nmags_rating\nmags_rating_entity\nmags_rating_option\nmags_rating_option_vote\nmags_rating_option_vote_aggregated\nmags_rating_store\nmags_rating_title\nmags_release_notification_viewer_log\nmags_report_compared_product_index\nmags_report_event\nmags_report_event_types\nmags_report_viewed_product_aggregated_daily\nmags_report_viewed_product_aggregated_monthly\nmags_report_viewed_product_aggregated_yearly\nmags_report_viewed_product_index\nmags_reporting_counts\nmags_reporting_module_status\nmags_reporting_orders\nmags_reporting_system_updates\nmags_reporting_users\nmags_review\nmags_review_detail\nmags_review_entity\nmags_review_entity_summary\nmags_review_status\nmags_review_store\nmags_sales_bestsellers_aggregated_daily\nmags_sales_bestsellers_aggregated_monthly\nmags_sales_bestsellers_aggregated_yearly\nmags_sales_creditmemo\nmags_sales_creditmemo_comment\nmags_sales_creditmemo_grid\nmags_sales_creditmemo_item\nmags_sales_invoice\nmags_sales_invoice_comment\nmags_sales_invoice_grid\nmags_sales_invoice_item\nmags_sales_invoiced_aggregated\nmags_sales_invoiced_aggregated_order\nmags_sales_order\nmags_sales_order_address\nmags_sales_order_aggregated_created\nmags_sales_order_aggregated_updated\nmags_sales_order_grid\nmags_sales_order_item\nmags_sales_order_payment\nmags_sales_order_status\nmags_sales_order_status_history\nmags_sales_order_status_label\nmags_sales_order_status_state\nmags_sales_order_tax\nmags_sales_order_tax_item\nmags_sales_payment_transaction\nmags_sales_refunded_aggregated\nmags_sales_refunded_aggregated_order\nmags_sales_sequence_meta\nmags_sales_sequence_profile\nmags_sales_shipment\nmags_sales_shipment_comment\nmags_sales_shipment_grid\nmags_sales_shipment_item\nmags_sales_shipment_track\nmags_sales_shipping_aggregated\nmags_sales_shipping_aggregated_order\nmags_salesrule\nmags_salesrule_coupon\nmags_salesrule_coupon_aggregated\nmags_salesrule_coupon_aggregated_order\nmags_salesrule_coupon_aggregated_updated\nmags_salesrule_coupon_usage\nmags_salesrule_customer\nmags_salesrule_customer_group\nmags_salesrule_label\nmags_salesrule_product_attribute\nmags_salesrule_website\nmags_search_query\nmags_search_synonyms\nmags_sendfriend_log\nmags_sequence_creditmemo_0\nmags_sequence_creditmemo_1\nmags_sequence_invoice_0\nmags_sequence_invoice_1\nmags_sequence_order_0\nmags_sequence_order_1\nmags_sequence_shipment_0\nmags_sequence_shipment_1\nmags_session\nmags_setup_module\nmags_shipping_tablerate\nmags_signifyd_case\nmags_sitemap\nmags_store\nmags_store_group\nmags_store_website\nmags_tax_calculation\nmags_tax_calculation_rate\nmags_tax_calculation_rate_title\nmags_tax_calculation_rule\nmags_tax_class\nmags_tax_order_aggregated_created\nmags_tax_order_aggregated_updated\nmags_temando_checkout_address\nmags_temando_order\nmags_temando_shipment\nmags_theme\nmags_theme_file\nmags_translation\nmags_ui_bookmark\nmags_url_rewrite\nmags_variable\nmags_variable_value\nmags_vault_payment_token\nmags_vault_payment_token_order_payment_link\nmags_weee_tax\nmags_widget\nmags_widget_instance\nmags_widget_instance_page\nmags_widget_instance_page_layout\nmags_wishlist\nmags_wishlist_item\nmags_wishlist_item_option\n```\n\nVerifying cache and cache_tag database tables contents with above defaulted database prefix = `mags_ ` when SSH session variable `DBPREFIX='mags_'` was set\n\n```\nn98-magerun2 db:query \"SELECT * from mags_cache limit 0,10;\" --skip-root-check\n\nn98-magerun2 db:query \"SELECT * from mags_cache_tag limit 0,10;\" --skip-root-check\n```\n\nMagento 2 database engine breakdown stats\n\n```\necho \"SELECT engine, count(*) tables, concat(round(sum(table_rows))) rows, concat(round(sum(data_length)/(1024*1024),2),'MB') data, concat(round(sum(index_length)/(1024*1024),2),'MB') idx, concat(round(sum(data_length+index_length)/(1024*1024),2),'MB') total_size, round(sum(index_length)/sum(data_length),2) idxfrac FROM information_schema.TABLES WHERE table_schema LIKE '$DBNAME' GROUP BY engine ORDER BY sum(data_length+index_length) DESC LIMIT 10;\" | mysql -t\n+--------+--------+------+--------+---------+------------+---------+\n| engine | tables | rows | data   | idx     | total_size | idxfrac |\n+--------+--------+------+--------+---------+------------+---------+\n| InnoDB |    326 | 5535 | 5.59MB | 11.88MB | 17.47MB    |    2.12 |\n| MEMORY |     14 | 0    | 0.00MB | 0.00MB  | 0.00MB     |    NULL |\n+--------+--------+------+--------+---------+------------+---------+\n```\n\ndefault Magento modules' status\n\n```\nphp $WEBROOT/bin/magento module:status\nList of enabled modules:\nMagento_Store\nMageHost_PerformanceDashboard\nMagento_Directory\nMagento_AdvancedPricingImportExport\nMagento_Config\nMagento_Backend\nMagento_Theme\nMagento_Eav\nMagento_Backup\nMagento_Customer\nMagento_AdminNotification\nMagento_BundleImportExport\nMagento_CacheInvalidate\nMagento_Indexer\nMagento_Cms\nMagento_Security\nMagento_CatalogImportExport\nMagento_Rule\nMagento_Cron\nMagento_Catalog\nMagento_Search\nMagento_CatalogUrlRewrite\nMagento_Widget\nMagento_Quote\nMagento_SalesSequence\nMagento_Payment\nMagento_CmsUrlRewrite\nMagento_User\nMagento_ConfigurableImportExport\nMagento_Msrp\nMagento_CatalogInventory\nMagento_Contact\nMagento_Cookie\nMagento_Newsletter\nMagento_CurrencySymbol\nMagento_Sales\nMagento_Integration\nMagento_CustomerImportExport\nMagento_Deploy\nMagento_Developer\nMagento_Dhl\nMagento_Authorization\nMagento_Downloadable\nMagento_ImportExport\nMagento_Bundle\nMagento_Email\nMagento_EncryptionKey\nMagento_Fedex\nMagento_GiftMessage\nMagento_Checkout\nMagento_GoogleAnalytics\nMagento_Ui\nMagento_GroupedImportExport\nMagento_GroupedProduct\nMagento_DownloadableImportExport\nMagento_CatalogRule\nMagento_InstantPurchase\nMagento_Analytics\nMagento_LayeredNavigation\nMagento_Marketplace\nMagento_MediaStorage\nMagento_ConfigurableProduct\nMagento_Multishipping\nMagento_NewRelicReporting\nMagento_Reports\nMagento_OfflinePayments\nMagento_SalesRule\nMagento_PageCache\nMagento_Vault\nMagento_Paypal\nMagento_Persistent\nMagento_ProductAlert\nMagento_ProductVideo\nMagento_CheckoutAgreements\nMagento_QuoteAnalytics\nMagento_ReleaseNotification\nMagento_Review\nMagento_RequireJs\nMagento_Shipping\nMagento_ReviewAnalytics\nMagento_Robots\nMagento_Rss\nMagento_CatalogRuleConfigurable\nMagento_Captcha\nMagento_SalesAnalytics\nMagento_SalesInventory\nMagento_OfflineShipping\nMagento_ConfigurableProductSales\nMagento_UrlRewrite\nMagento_CatalogSearch\nMagento_CustomerAnalytics\nMagento_SendFriend\nMagento_Wishlist\nMagento_Signifyd\nMagento_Sitemap\nMagento_Authorizenet\nMagento_Swagger\nMagento_Swatches\nMagento_SwatchesLayeredNavigation\nMagento_Tax\nMagento_TaxImportExport\nMagento_GoogleAdwords\nMagento_Translation\nMagento_GoogleOptimizer\nMagento_Ups\nMagento_SampleData\nMagento_CatalogAnalytics\nMagento_Usps\nMagento_Variable\nMagento_Braintree\nMagento_Version\nMagento_Webapi\nMagento_WebapiSecurity\nMagento_Weee\nMagento_CatalogWidget\nDotdigitalgroup_Email\nMagento_WishlistAnalytics\nShopial_Facebook\nTemando_Shipping\n\nList of disabled modules:\nNone\n```\n\nAsynchronous Indexing\n\n```\nphp $WEBROOT/bin/magento indexer:show-mode\nDesign Config Grid:                                Update by Schedule\nCustomer Grid:                                     Update by Schedule\nProduct Flat Data:                                 Update by Schedule\nCategory Flat Data:                                Update by Schedule\nCategory Products:                                 Update by Schedule\nProduct Categories:                                Update by Schedule\nProduct Price:                                     Update by Schedule\nProduct EAV:                                       Update by Schedule\nStock:                                             Update by Schedule\nCatalog Rule Product:                              Update by Schedule\nCatalog Product Rule:                              Update by Schedule\nCatalog Search:                                    Update by Schedule\n```\n\nstatic file location\n\n```\nls -lah pub/static/frontend/Magento/luma/en_US/css/\ntotal 392K\ndrwxr-sr-x  2 root nginx 4.0K Mar 14 08:09 .\ndrwxr-sr-x 68 root nginx 4.0K Mar 14 08:09 ..\n-rw-r--r--  1 root nginx 5.7K Mar 14 08:09 email.css\n-rw-r--r--  1 root nginx 2.0K Mar 14 08:09 email-fonts.css\n-rw-r--r--  1 root nginx 8.8K Mar 14 08:09 email-inline.css\n-rw-r--r--  1 root nginx 1.2K Mar 14 08:09 print.css\n-rw-r--r--  1 root nginx  64K Mar 14 08:09 styles-l.css\n-rw-r--r--  1 root nginx 290K Mar 14 08:09 styles-m.css\n```\n\n```\nls -lah pub/static/_cache/merged/\ntotal 2.4M\ndrwxr-sr-x 2 nginx nginx 4.0K Mar 14 12:13 .\ndrwxr-sr-x 3 nginx nginx 4.0K Mar 14 08:10 ..\n-rw-r--r-- 1 nginx nginx 297K Mar 14 08:10 9de8797d0c615276fc794278a0af8df2.css\n-rw-r--r-- 1 nginx nginx 647K Mar 14 12:13 9e492d36090b18d041a5555bf3f0fd98.css\n-rw-r--r-- 1 nginx nginx 131K Mar 14 11:25 a814ec60c7b703d594ceda92980506f6.js\n-rw-r--r-- 1 nginx nginx 104K Mar 14 08:10 c0b5661e7cfc4d3e29c8fc8495e4d56e.js\n-rw-r--r-- 1 nginx nginx  99K Mar 14 11:09 ddce5b0a41e6dbae4b6f458053932955.js\n-rw-r--r-- 1 nginx nginx 483K Mar 14 11:09 e6a662994948b56fa4f39e1f141aaed3.css\n-rw-r--r-- 1 nginx nginx 669K Mar 14 11:25 fe7035d3b7b90d9b17c968ffd74cf349.css\n```\n\n```\nls -lah pub/static/frontend/Magento/luma/en_US/jquery            \ntotal 1.2M\ndrwxr-sr-x  6 root nginx 4.0K Mar 14 08:08 .\ndrwxr-sr-x 68 root nginx 4.0K Mar 14 08:09 ..\ndrwxr-sr-x  5 root nginx 4.0K Mar 14 08:08 colorpicker\ndrwxr-sr-x  4 root nginx 4.0K Mar 14 08:08 editableMultiselect\ndrwxr-sr-x  6 root nginx 4.0K Mar 14 08:08 fileUploader\n-rw-r--r--  1 root nginx 1.5K Mar 14 08:08 jquery.ba-hashchange.min.js\n-rw-r--r--  1 root nginx 2.2K Mar 14 08:08 jquery.cookie.js\n-rw-r--r--  1 root nginx 5.7K Mar 14 08:08 jquery.details.js\n-rw-r--r--  1 root nginx 5.0K Mar 14 08:08 jquery.hoverIntent.js\n-rw-r--r--  1 root nginx 6.1K Mar 14 08:08 jquery.metadata.js\n-rw-r--r--  1 root nginx  17K Mar 14 08:08 jquery-migrate.js\n-rw-r--r--  1 root nginx  95K Mar 14 08:08 jquery.min.js\n-rw-r--r--  1 root nginx  24K Mar 14 08:08 jquery.mobile.custom.js\n-rw-r--r--  1 root nginx 1.4K Mar 14 08:08 jquery.parsequery.js\n-rw-r--r--  1 root nginx 6.9K Mar 14 08:08 jquery.storageapi.min.js\n-rw-r--r--  1 root nginx 7.8K Mar 14 08:08 jquery.tabs.js\n-rw-r--r--  1 root nginx 441K Mar 14 08:08 jquery-ui-1.9.2.js\n-rw-r--r--  1 root nginx 427K Mar 14 08:08 jquery-ui.js\n-rw-r--r--  1 root nginx  71K Mar 14 08:08 jquery-ui-timepicker-addon.js\n-rw-r--r--  1 root nginx  53K Mar 14 08:08 jquery.validate.js\ndrwxr-sr-x  3 root nginx 4.0K Mar 14 08:08 jstree\n```\n\n![](/screenshots/magento-222-admin-01.png)\n\n![](/screenshots/magento-222-admin-01b.png)\n\n![](/screenshots/magento-222-admin-03.png)\n\n![](/screenshots/magento-222-admin-04.png)\n\n![](/screenshots/magento-222-admin-05.png)\n\n![](/screenshots/magento-222-admin-06b.png)\n\nPerformance Dashboard Extension\n\n![](/screenshots/magento-222-admin-07.png)\n\n![](/screenshots/magento-222-admin-08.png)\n\n## Magento 2 Upgrade\n\nUpgrading Magento 2 can also be done via command line as per instructions outlined in [official documentation](http://devdocs.magento.com/guides/v2.2/comp-mgr/cli/cli-upgrade.html).\n\n### Upgrading to Magento 2.2.3 CE.\n\nAlso added checks if Varnish \u0026 Redis cache are in play as per setup in this guide to restart Varnish Cache and flush Redis caches.\n\n```\nvhostname=magento.domain.com\nWEBROOT=\"/home/nginx/domains/${vhostname}/public\"\ncd $WEBROOT\nphp $WEBROOT/bin/magento maintenance:enable\ncomposer require magento/product-community-edition 2.2.3 --no-update\ncomposer update\nrm -rf $WEBROOT/var/cache/*\nrm -rf $WEBROOT/var/page_cache/*\nrm -rf $WEBROOT/generated/code/*\nphp $WEBROOT/bin/magento setup:upgrade\nphp $WEBROOT/bin/magento setup:static-content:deploy -f\nphp $WEBROOT/bin/magento setup:di:compile\n#composer dump-autoload -o\nphp $WEBROOT/bin/magento cache:clean\nphp $WEBROOT/bin/magento cache:flush\nphp $WEBROOT/bin/magento cache:status\nphp $WEBROOT/bin/magento cache:disable\nphp $WEBROOT/bin/magento cache:enable\nphp $WEBROOT/bin/magento cache:flush full_page\nphp $WEBROOT/bin/magento maintenance:disable\nphp $WEBROOT/bin/magento deploy:mode:set production\nchown -R nginx:nginx \"/home/nginx/domains/${vhostname}/public\"\nservice nginx restart\nif [ -f \"$(which varnishadm)\" ]; then service varnish restart; fi\nif [ -f \"$(which redis-cli)\" ]; then redis-cli -n 12 FLUSHALL; redis-cli -n 13 FLUSHALL; redis-cli -n 14 FLUSHALL; fi\n```\n\nspecific commands' example output\n\n```\ncomposer update\nDo not run Composer as root/super user! See https://getcomposer.org/root for details\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nPackage operations: 0 installs, 30 updates, 0 removals\n  - Updating tedivm/jshrink (v1.2.0 =\u003e v1.3.0): Loading from cache\n  - Updating magento/framework (101.0.2 =\u003e 101.0.3): Loading from cache\n  - Updating magento/module-config (101.0.2 =\u003e 101.0.3): Loading from cache\n  - Updating magento/module-backend (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-ui (101.0.2 =\u003e 101.0.3): Loading from cache\n  - Updating magento/module-variable (100.2.1 =\u003e 100.2.2): Loading from cache\n  - Updating magento/module-catalog (102.0.2 =\u003e 102.0.3): Loading from cache\n  - Updating magento/module-eav (101.0.1 =\u003e 101.0.2): Loading from cache\n  - Updating magento/module-customer (101.0.2 =\u003e 101.0.3): Loading from cache\n  - Updating magento/module-reports (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-tax (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-shipping (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-directory (100.2.1 =\u003e 100.2.2): Loading from cache\n  - Updating magento/module-theme (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-cms (102.0.2 =\u003e 102.0.3): Loading from cache\n  - Updating magento/module-checkout (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-downloadable (100.2.1 =\u003e 100.2.2): Loading from cache\n  - Updating magento/module-newsletter (100.2.1 =\u003e 100.2.2): Loading from cache\n  - Updating magento/module-review (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-import-export (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating magento/module-backup (100.2.1 =\u003e 100.2.2): Loading from cache\n  - Updating magento/module-usps (100.2.0 =\u003e 100.2.1): Loading from cache\n  - Updating magento/module-configurable-product (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating braintree/braintree_php (3.25.0 =\u003e 3.27.0): Loading from cache\n  - Updating magento/module-braintree (100.2.2 =\u003e 100.2.3): Loading from cache\n  - Updating ramsey/uuid (3.7.1 =\u003e 3.7.3): Loading from cache\n  - Updating tubalmartin/cssmin (v4.1.0 =\u003e v4.1.1): Loading from cache\n  - Updating colinmollenhour/cache-backend-redis (1.10.2 =\u003e 1.10.4): Loading from cache\n  - Updating magento/magento2-base (2.2.2 =\u003e 2.2.3): Loading from cache\nPackage sjparkinson/static-review is abandoned, you should avoid using it. Use phpro/grumphp instead.\nWriting lock file\nGenerating autoload files\n```\n\n```\nphp $WEBROOT/bin/magento setup:static-content:deploy -f\n\nDeploy using quick strategy\nfrontend/Magento/blank/en_US            2108/2108           ============================ 100% %  13 secs             \nadminhtml/Magento/backend/en_US         2105/2105           ============================ 100% %  15 secs             \nfrontend/Magento/luma/en_US             2124/2124           ============================ 100% %  15 secs\n\nExecution time: 65.690301895142\n```\n\n```\nphp $WEBROOT/bin/magento setup:di:compile\nCompilation was started.\nInterception cache generation... 7/7 [============================] 100% 1 min 196.0 MiB\nGenerated code and dependency injection configuration successfully.\n```\n\n### Verify Magento Upgrade\n\nUnfortunately, running into a problem in that all reported Magento 2 caches are reported as disabled in admin area GUI but command line says they're all enabled (set to 1) ? After a few cache flushes and switching between production and developer mode, and finally back to production mode, then the admin are GUI showed all caches as enabled ?\n\n```\nvhostname=magento.domain.com\nWEBROOT=\"/home/nginx/domains/${vhostname}/public\"\ncd $WEBROOT\nphp $WEBROOT/bin/magento indexer:show-mode\nphp $WEBROOT/bin/magento deploy:mode:show\nn98-magerun2 cache:list --skip-root-check\nn98-magerun2 sys:check --skip-root-check\nn98-magerun2 sys:info --skip-root-check\n```\n\n```\nn98-magerun2 cache:list --skip-root-check\n\n                       \n  Magento Cache Types  \n                       \n\n+------------------------+--------------------------------+---------+\n| Name                   | Type                           | Enabled |\n+------------------------+--------------------------------+---------+\n| config                 | Configuration                  | 1       |\n| layout                 | Layouts                        | 1       |\n| block_html             | Blocks HTML output             | 1       |\n| collections            | Collections Data               | 1       |\n| reflection             | Reflection Data                | 1       |\n| db_ddl                 | Database DDL operations        | 1       |\n| eav                    | EAV types and attributes       | 1       |\n| customer_notification  | Customer Notification          | 1       |\n| config_integration     | Integrations Configuration     | 1       |\n| config_integration_api | Integrations API Configuration | 1       |\n| full_page              | Page Cache                     | 1       |\n| translate              | Translations                   | 1       |\n| config_webservice      | Web Services Configuration     | 1       |\n+------------------------+--------------------------------+---------+\n```\n\n```\nn98-magerun2 cache:status --skip-root-check\nCurrent status:\n                        config: 1\n                        layout: 1\n                    block_html: 1\n                   collections: 1\n                    reflection: 1\n                        db_ddl: 1\n                           eav: 1\n         customer_notification: 1\n            config_integration: 1\n        config_integration_api: 1\n                     full_page: 1\n                     translate: 1\n             config_webservice: 1\n```\n\n```\nn98-magerun2 sys:info --skip-root-check\n\n                              \n  Magento System Information  \n                              \n\n+------------------+-----------------------------------------------+\n| name             | value                                         |\n+------------------+-----------------------------------------------+\n| Name             | Magento                                       |\n| Version          | 2.2.3                                         |\n| Edition          | Community                                     |\n| Root             | /home/nginx/domains/magento.domain.com/public |\n| Application Mode | production                                    |\n| Session          | redis                                         |\n| Crypt Key        | d45f000b87ce82******************              |\n| Install Date     | Sun, 11 Mar 2018 20:40:12 +0000               |\n| Cache Backend    | Cm_Cache_Backend_Redis                        |\n| Vendors          | Magento, MageHost, Dotdigitalgroup, Temando   |\n| Attribute Count  | 134                                           |\n| Customer Count   | 0                                             |\n| Category Count   | 2                                             |\n| Product Count    | 0                                             |\n+------------------+-----------------------------------------------+\n```\n\n## Magento 2 Page Speed Tests\n\nQuick [WebPageTest.org test](https://www.webpagetest.org). Check out my guide on [How to use webpagetest.org for page load speed testing](https://community.centminmod.com/threads/how-to-use-webpagetest-org-for-page-load-speed-testing.13859/).\n\nDefault Magento 2.2.2 theme has up to 168 HTTP requests of which 144 are Javascript assets even with CSS and JS merged files enabled ! Javascript bundling is disabled by default.\n\n![](/screenshots/wpt-magento-222-centminmod-nginx-default-theme-cable-dulles-01.png)\n\n![](/screenshots/wpt-magento-222-centminmod-nginx-default-theme-cable-dulles-02.png)\n\n![](/screenshots/wpt-magento-222-centminmod-nginx-default-theme-cable-dulles-03.png)\n\n![](/screenshots/wpt-magento-222-centminmod-nginx-default-theme-cable-dulles-04.png)\n\n## Magento 2 Redis Benchmarks\n\nUpdate: added a [Magento 2 Bugs](https://github.com/centminmod/centminmod-magento2#magento-2-bugs) of which one bug already affects Magento 2.2.2 causing high MySQL / PHP related loads so may of affected benchmarks too. I have 428 pending cron sheduled jobs.\n\n```\nn98-magerun2 db:query \"SELECT * FROM mags_cron_schedule WHERE status='pending';\" --skip-root-check | wc -l\n428\n```\n\nRedis server can be configured to default TCP mode or you can take advantage of using both TCP mode + Unix Socket modes so configure web apps that support Unix Socket to use that whike keaving web apps that only support TCP mode to use that. From my experience which Unix Sockets maybe faster, they don't scale in terms of higher concurrency load levels as TCP connections.\n\nQuick benchmarks are below of Redis caching TCP vs Unix Socket using my custom forked [wrk-cmm](https://github.com/centminmod/wrk/tree/centminmod) load testing tool. Pay particular attention to latency distribution at 99% percentile mark and requests/sec and thread stats for Time To First Byte (TTFB) differences. Below wrk-cmm tests were lightl testing with 2 threads and 2 concurrent users over 10 second duration and testing for gzip encoded compressed HTTP requests.\n\nCurrent Magento System Info\n\n```\nn98-magerun2 sys:info --skip-root-check\n\n                              \n  Magento System Information  \n                              \n\n+------------------+-----------------------------------------------+\n| name             | value                                         |\n+------------------+-----------------------------------------------+\n| Name             | Magento                                       |\n| Version          | 2.2.2                                         |\n| Edition          | Community                                     |\n| Root             | /home/nginx/domains/magento.domain.com/public |\n| Application Mode | production                                    |\n| Session          | redis                                         |\n| Crypt Key        | d45f000b87ce82*******************             |\n| Install Date     | Sun, 11 Mar 2018 20:40:12 +0000               |\n| Cache Backend    | Cm_Cache_Backend_Redis                        |\n| Vendors          | Magento, MageHost, Dotdigitalgroup, Temando   |\n| Attribute Count  | 134                                           |\n| Customer Count   | 0                                             |\n| Category Count   | 2                                             |\n| Product Count    | 0                                             |\n+------------------+-----------------------------------------------+\n```\n\nRedis TCP Mode\n\n```\nredisserver=127.0.0.1\n# lz4 or gzip\ncompresstype=lz4\nport=6379\nphp $WEBROOT/bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=$redisserver --cache-backend-redis-db=12 --cache-backend-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=$redisserver --page-cache-redis-db=13 --page-cache-redis-compress-data=$compresstype --page-cache-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:config:set --session-save=redis --session-save-redis-host=$redisserver --session-save-redis-log-level=3 --session-save-redis-db=14 --session-save-redis-compression-lib=$compresstype --session-save-redis-max-concurrency=4 --session-save-redis-first-lifetime=600 --session-save-redis-bot-first-lifetime=60 --session-save-redis-bot-lifetime=7200 --session-save-redis-min-lifetime=60 --session-save-redis-max-lifetime=2592000 --session-save-redis-break-after-frontend=60 --session-save-redis-break-after-adminhtml=60 --session-save-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:static-content:deploy\nphp $WEBROOT/bin/magento setup:di:compile\ncomposer dump-autoload -o\n# ensure correct Centmin Mod Nginx permissions\nchown -R nginx:nginx \"/home/nginx/domains/${vhostname}/public\"\n```\n\n```\ndomain=https://magento.domain.com\nwrk-cmm -t2 -c2 -d10s --breakout -H 'Accept-Encoding: gzip' -s scripts/setup.lua --latency $domain\nthread 1 created\nthread 2 created\nRunning 10s test @ https://magento.domain.com\n  2 threads and 2 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    31.15ms   10.16ms 158.71ms   97.59%\n    Connect    14.00ms    5.32ms  17.76ms  100.00%\n    TTFB       30.83ms   10.10ms 158.42ms   97.89%\n    TTLB      316.32us  266.73us   4.59ms   97.25%\n    Req/Sec    32.83      5.93    40.00     62.63%\n  Latency Distribution\n     50%   29.45ms\n     75%   31.67ms\n     90%   35.71ms\n     99%   80.05ms\n  655 requests in 10.06s, 4.64MB read\nRequests/sec:     65.14\nTransfer/sec:    472.44KB\nthread 1 made 330 requests and got 328 responses\nthread 2 made 328 requests and got 327 responses\n```\n\nRedis Unix socket Mode\n\n```\nredisserver=/var/run/redis/redis.sock\n# lz4 or gzip\ncompresstype=lz4\nport=0\nphp $WEBROOT/bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=$redisserver --cache-backend-redis-db=12 --cache-backend-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=$redisserver --page-cache-redis-db=13 --page-cache-redis-compress-data=$compresstype --page-cache-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:config:set --session-save=redis --session-save-redis-host=$redisserver --session-save-redis-log-level=3 --session-save-redis-db=14 --session-save-redis-compression-lib=$compresstype --session-save-redis-max-concurrency=4 --session-save-redis-first-lifetime=600 --session-save-redis-bot-first-lifetime=60 --session-save-redis-bot-lifetime=7200 --session-save-redis-min-lifetime=60 --session-save-redis-max-lifetime=2592000 --session-save-redis-break-after-frontend=60 --session-save-redis-break-after-adminhtml=60 --session-save-redis-port=$port\n\nphp $WEBROOT/bin/magento setup:static-content:deploy\nphp $WEBROOT/bin/magento setup:di:compile\ncomposer dump-autoload -o\n# ensure correct Centmin Mod Nginx permissions\nchown -R nginx:nginx \"/home/nginx/domains/${vhostname}/public\"\n```\n\n```\ndomain=https://mag","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmod-magento2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Fcentminmod-magento2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmod-magento2/lists"}