{"id":92,"date":"2023-07-15T06:47:49","date_gmt":"2023-07-15T06:47:49","guid":{"rendered":"https:\/\/hostlatte.com\/blog\/?p=92"},"modified":"2023-07-15T06:54:03","modified_gmt":"2023-07-15T06:54:03","slug":"boost-performance-easy-memcached-installation-on-centos-7","status":"publish","type":"post","link":"https:\/\/hostlatte.com\/blog\/boost-performance-easy-memcached-installation-on-centos-7\/","title":{"rendered":"Boost Performance: Easy Memcached Installation on CentOS 7"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><strong>Introduction:<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Memcached is a popular open-source caching system that helps improve the performance and scalability of web applications by storing frequently accessed data in memory. If you&#8217;re using CentOS 7 as your server operating system and want to harness the power of Memcached, you&#8217;ve come to the right place. In this tutorial, we&#8217;ll walk you through the process of installing Memcached on <a href=\"https:\/\/www.centos.org\/\" target=\"_blank\" rel=\"noopener sponsored\" title=\"\">CentOS 7<\/a>.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step 1: Update the System<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Before installing any new software, it&#8217;s essential to ensure that your system is up to date. Open a terminal or SSH into your CentOS 7 server and run the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo yum update<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step 2: Install Memcached<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Now that your system is up to date, you can proceed with the <a href=\"https:\/\/memcached.org\/\" target=\"_blank\" rel=\"noopener sponsored ugc\" title=\"\">Memcached<\/a> installation. Run the following command in the terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install memcached<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step 3: Start and Enable Memcached<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">After the installation is complete, start the Memcached service and enable it to start automatically on system boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start memcached<br>sudo systemctl enable memcached<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step 4: Configure Memcached<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">By default, Memcached listens on the local loopback interface (127.0.0.1) and uses the default <a href=\"https:\/\/en.wikipedia.org\/wiki\/Port_(computer_networking)\" target=\"_blank\" rel=\"noopener sponsored ugc\" title=\"\">port<\/a> (11211). If you want to modify these settings, open the Memcached configuration file using a text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/sysconfig\/memcached<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">Modify the <code>OPTIONS<\/code> line according to your requirements. For example, to listen on all network interfaces, change the line to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>OPTIONS=\"-l 0.0.0.0\"<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">Save the file and exit the text editor.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step 5: Adjust <a href=\"https:\/\/en.wikipedia.org\/wiki\/Firewall_(computing)\" target=\"_blank\" rel=\"noopener sponsored ugc\" title=\"\">Firewall<\/a> Settings<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">If you have an active firewall, you&#8217;ll need to allow incoming connections to the Memcached port (default: 11211). Run the following command to open the port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --zone=public --add-port=11211\/tcp --permanent<br>sudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Step 6: Test Memcached<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">To verify that Memcached is running correctly, you can test it by using the <code><a href=\"https:\/\/en.wikipedia.org\/wiki\/Telnet\" target=\"_blank\" rel=\"noopener sponsored ugc\" title=\"\">telnet<\/a><\/code> command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code>telnet localhost 11211<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">If the connection is successful, you&#8217;ll see the Memcached server response. Type <code>quit<\/code> to exit the telnet session.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Conclusion:<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">Congratulations! You have successfully installed Memcached on CentOS 7. By caching frequently accessed data, Memcached can significantly improve the performance and scalability of your web applications. Remember to customize the Memcached configuration according to your needs and secure it by adjusting firewall settings.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Now that you have Memcached up and running, you can integrate it into your web applications to take advantage of its caching capabilities and boost your website&#8217;s speed and responsiveness.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Happy caching!<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Note: <\/strong>This tutorial assumes you have administrative access to a CentOS 7 server. Please exercise caution and ensure you have appropriate backups before making any changes to your server configuration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Memcached is a popular open-source caching system that helps improve the performance and scalability of web applications by storing frequently accessed data in memory. If you&#8217;re using CentOS 7 as your server operating system and want to harness the power of Memcached, you&#8217;ve come to the right place. In this tutorial, we&#8217;ll walk you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":96,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[288,286,287,293,291,292,285,294,295,290,289],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/posts\/92"}],"collection":[{"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":3,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions\/95"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/media\/96"}],"wp:attachment":[{"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostlatte.com\/blog\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}