{"id":2180,"date":"2016-07-06T13:12:36","date_gmt":"2016-07-06T17:12:36","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2180"},"modified":"2016-09-30T13:49:58","modified_gmt":"2016-09-30T17:49:58","slug":"setup-memcache-ubuntu-14","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/","title":{"rendered":"How to Setup Memcache on Ubuntu 14"},"content":{"rendered":"<p>Memcache is an efficient, RAM-based key-value store that can be deployed as part of a strategy to speed up a site or service. In cases where a given piece of data rarely changes and can be associated with a unique key, Memcache can store the association and quickly return it on demand. In this manner, slow database queries or filesystem accesses can be keyed off of their query content or filename, thus minimizing interaction with the slow system.<\/p>\n<h2>Getting Started<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) running Ubuntu 14.<br \/>\n\u2022 A LAMP stack configured<br \/>\n\u2022 Root Access to your server<\/p>\n<h2>Tutorial<\/h2>\n<p>The package for the Memcache daemon is called memcached. We&#8217;ll begin by installing this package.<\/p>\n<p><code>apt-get install memcached -y<\/code><\/p>\n<p>In order to integrate Memcache with PHP, we&#8217;ll install its extension. This will make the library available for use in any PHP-based applications you may wish to run on this server.<\/p>\n<p><code>apt-get install php5-memcached<\/code><\/p>\n<p>Memcached must now be configured to meet your needs. Edit its configuration.<\/p>\n<p><code>nano \/etc\/memcached.conf<\/code><\/p>\n<p>The daemon has a variety of switches you can use to tune performance and access. Of particular note is the &#8220;-p&#8221; switch which sets the daemon&#8217;s port. Additionally, &#8220;-c&#8221; limits the maximum connections allowed, and &#8220;-m&#8221; sets the amount of RAM allocated to the daemon and its cache.<\/p>\n<p>Having installed the PHP module and configured Memcache, we must restart both Apache and Memcache so the changes are acted upon. We&#8217;ll do that now.<\/p>\n<p><code>service apache2 restart<br \/>\nservice memcached restart<\/code><\/p>\n<p>In order to integrate with PHP, the memcached module must be loaded. We&#8217;ll validate that everything is correctly configured and enabled below.<\/p>\n<p><code>php -m | grep memcached<br \/>\nmemcached<\/code><\/p>\n<p>A phpinfo webpage is a great way to evaluate your PHP runtime environment. The phpinfo function prints a variety of diagnostic information about your PHP setup. In this case, it should provide information on the memcached module.<\/p>\n<p><code>nano \/var\/www\/html\/index.php<\/code><\/p>\n<p><code class=\"gris\">&lt;?php<br \/>\nphpinfo();<br \/>\n?&gt;<\/code><\/p>\n<p>To ensure that everything is set up, visit http:\/\/your_ip\/index.php. Study the page, looking for details on the memcached module.<\/p>\n<h2>Conclusion<\/h2>\n<p>Memcache is now installed, configured and running. It is also integrated into your PHP runtime, which is running in the installed Apache web server. Any newly-installed PHP applications can now capitalize on your Memcache installation to provide a fast, reliable caching layer for any slow operations. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Memcache is an efficient, RAM-based key-value store that can be deployed as part of a strategy to speed up a site or service. In cases where a given piece of data rarely changes and can be associated with a unique key, Memcache can store the association and quickly return it on demand. In this manner,<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-2180","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Setup Memcache on Ubuntu 14 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will walk you through the setup of Memcache on your Ubuntu 14 Server. Read now and speed up everything from MySQL queries to REST requests!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Setup Memcache on Ubuntu 14 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will walk you through the setup of Memcache on your Ubuntu 14 Server. Read now and speed up everything from MySQL queries to REST requests!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-06T17:12:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-09-30T17:49:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How to Setup Memcache on Ubuntu 14\",\"datePublished\":\"2016-07-06T17:12:36+00:00\",\"dateModified\":\"2016-09-30T17:49:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/\"},\"wordCount\":395,\"commentCount\":0,\"articleSection\":[\"Web Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/\",\"name\":\"How to Setup Memcache on Ubuntu 14 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"datePublished\":\"2016-07-06T17:12:36+00:00\",\"dateModified\":\"2016-09-30T17:49:58+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will walk you through the setup of Memcache on your Ubuntu 14 Server. Read now and speed up everything from MySQL queries to REST requests!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/setup-memcache-ubuntu-14\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Setup Memcache on Ubuntu 14\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Setup Memcache on Ubuntu 14 - Globo.Tech","description":"This tutorial will walk you through the setup of Memcache on your Ubuntu 14 Server. Read now and speed up everything from MySQL queries to REST requests!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/","og_locale":"en_US","og_type":"article","og_title":"How to Setup Memcache on Ubuntu 14 - Globo.Tech","og_description":"This tutorial will walk you through the setup of Memcache on your Ubuntu 14 Server. Read now and speed up everything from MySQL queries to REST requests!","og_url":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/","og_site_name":"Globo.Tech","article_published_time":"2016-07-06T17:12:36+00:00","article_modified_time":"2016-09-30T17:49:58+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How to Setup Memcache on Ubuntu 14","datePublished":"2016-07-06T17:12:36+00:00","dateModified":"2016-09-30T17:49:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/"},"wordCount":395,"commentCount":0,"articleSection":["Web Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/","url":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/","name":"How to Setup Memcache on Ubuntu 14 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-07-06T17:12:36+00:00","dateModified":"2016-09-30T17:49:58+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will walk you through the setup of Memcache on your Ubuntu 14 Server. Read now and speed up everything from MySQL queries to REST requests!","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-14\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Setup Memcache on Ubuntu 14"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2180"}],"version-history":[{"count":6,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2180\/revisions"}],"predecessor-version":[{"id":2890,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2180\/revisions\/2890"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}