{"id":6823,"date":"2017-10-11T12:40:47","date_gmt":"2017-10-11T16:40:47","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=6823"},"modified":"2017-10-11T12:40:47","modified_gmt":"2017-10-11T16:40:47","slug":"install-redis-on-a-centosrhelcpanel-server","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/","title":{"rendered":"Install Redis on a CentOS\/RHEL\/cPanel Server"},"content":{"rendered":"<p>Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C. It\u2019s a \u201cNoSQL\u201d key-value data store. More precisely, it is a data structure server.<\/p>\n<p>To install Redis as daemon on a CentOS\/RHEL\/cPanel server, complete the following steps<\/p>\n<pre>\n<code>cd \/usr\/local\/\nwget http:\/\/download.redis.io\/releases\/redis-stable.tar.gz\ntar -xvzf redis-stable.tar.gz\ncd redis*\nmake\ncp src\/redis-server \/usr\/local\/bin\ncp src\/redis-cli \/usr\/local\/bin\nmkdir -p \/etc\/redis\nmkdir -p \/var\/redis\ncp redis.conf \/etc\/redis\/redis.conf<\/code><\/pre>\n<p>Next, open the\/etc\/redis\/redis.conf file using vim or nano and adjust the values to the ones shown below:<\/p>\n<pre>\n<code>daemonize yes\nport 6379\nbind 127.0.0.1\ndir  \/var\/redis\/\nlogfile  \/var\/log\/redis.log\npidfile  \/var\/run\/redis.pid<\/code><\/pre>\n<p>Then, create a new file \/etc\/init.d\/redis and add the following contents to it ( Reference https:\/\/gist.github.com\/paulrosania\/257849 ). Now, make it executable ( chmod +x \/etc\/init.d\/redis ).<\/p>\n<pre>\n<code>#!\/bin\/sh\n#\n# redis - this script starts and stops the redis-server daemon\n#\n# chkconfig:   - 85 15 \n# description:  Redis is a persistent key-value database\n# processname: redis-server\n# config:      \/etc\/redis\/redis.conf\n# config:      \/etc\/sysconfig\/redis\n# pidfile:     \/var\/run\/redis.pid\n \n# Source function library.\n. \/etc\/rc.d\/init.d\/functions\n \n# Source networking configuration.\n. \/etc\/sysconfig\/network\n \n# Check that networking is up.\n[ \"$NETWORKING\" = \"no\" ] && exit 0\n \nredis=\"\/usr\/local\/bin\/redis-server\"\nprog=$(basename $redis)\n \nREDIS_CONF_FILE=\"\/etc\/redis\/redis.conf\"\n \n[ -f \/etc\/sysconfig\/redis ] && . \/etc\/sysconfig\/redis\n \nlockfile=\/var\/lock\/subsys\/redis\n \nstart() {\n    [ -x $redis ] || exit 5\n    [ -f $REDIS_CONF_FILE ] || exit 6\n    echo -n $\"Starting $prog: \"\n    daemon $redis $REDIS_CONF_FILE\n    retval=$?\n    echo\n    [ $retval -eq 0 ] && touch $lockfile\n    return $retval\n}\n \nstop() {\n    echo -n $\"Stopping $prog: \"\n    killproc $prog -QUIT\n    retval=$?\n    echo\n    [ $retval -eq 0 ] && rm -f $lockfile\n    return $retval\n}\n \nrestart() {\n    stop\n    start\n}\n \nreload() {\n    echo -n $\"Reloading $prog: \"\n    killproc $redis -HUP\n    RETVAL=$?\n    echo\n}\n \nforce_reload() {\n    restart\n}\n \nrh_status() {\n    status $prog\n}\n \nrh_status_q() {\n    rh_status >\/dev\/null 2>&1\n}\n \ncase \"$1\" in\n    start)\n        rh_status_q && exit 0\n        $1\n        ;;\n    stop)\n        rh_status_q || exit 0\n        $1\n        ;;\n    restart|configtest)\n        $1\n        ;;\n    reload)\n        rh_status_q || exit 7\n        $1\n        ;;\n    force-reload)\n        force_reload\n        ;;\n    status)\n        rh_status\n        ;;\n    condrestart|try-restart)\n        rh_status_q || exit 0\n\t    ;;\n    *)\n        echo $\"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}\"\n        exit 2\nesac<\/code><\/pre>\n<p>Now make sure the daemon will start after server reboot.<\/p>\n<pre>\n<code>chkconfig --add redis\nchkconfig redis on\n<\/code>\n<\/pre>\n<p>Now, you will want to touch \/etc\/redis\/local.conf and put the following configs for redis in the file so it to work properly.  go inside the \/etc\/redis\/redis.conf file.<\/p>\n<pre>\n<code>include \/etc\/redis\/local.conf<\/code><\/pre>\n<p>Now we can start redis using command <\/p>\n<pre>\n<code>\/etc\/init.d\/redis start<\/code><\/pre>\n<p>To make sure redis is working, run the command <\/p>\n<pre>\n<code>redis-cli ping <\/code><\/pre>\n<p>from the CLI. If you get the result \u201cPONG\u201d, this will imply that redis is working correctly.<\/p>\n<p>Now, to install the redis PHP extension, use the following commands (Note: if you run EA4 in WHM, install it via the PECL Module install feature).<\/p>\n<pre>\n<code>pecl install redis<\/code><\/pre>\n<p>Now open your php.ini file (on a cPanel server) <\/p>\n<p>\/usr\/local\/lib\/php.ini <\/p>\n<p>and add the following line to it<\/p>\n<pre>\n<code>extension=redis.so<\/code><\/pre>\n<p>Now restart Apache to apply the changes to php.ini file.<\/p>\n<pre>\n<code>service httpd restart<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C. It\u2019s a \u201cNoSQL\u201d key-value data store. More precisely, it is a data structure server. To install Redis as daemon on a CentOS\/RHEL\/cPanel server, complete the following steps cd \/usr\/local\/ wget http:\/\/download.redis.io\/releases\/redis-stable.tar.gz tar -xvzf redis-stable.tar.gz cd redis* make&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-6823","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Install Redis on a CentOS\/RHEL\/cPanel Server - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Redis on a CentOS\/RHEL\/cPanel Server - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C. It\u2019s a \u201cNoSQL\u201d key-value data store. More precisely, it is a data structure server. To install Redis as daemon on a CentOS\/RHEL\/cPanel server, complete the following steps cd \/usr\/local\/ wget http:\/\/download.redis.io\/releases\/redis-stable.tar.gz tar -xvzf redis-stable.tar.gz cd redis* make... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-11T16:40:47+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Install Redis on a CentOS\\\/RHEL\\\/cPanel Server\",\"datePublished\":\"2017-10-11T16:40:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/\"},\"wordCount\":244,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/\",\"name\":\"Install Redis on a CentOS\\\/RHEL\\\/cPanel Server - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2017-10-11T16:40:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-redis-on-a-centosrhelcpanel-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Redis on a CentOS\\\/RHEL\\\/cPanel Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Redis on a CentOS\/RHEL\/cPanel Server - Linux Shtuff","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:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/","og_locale":"en_US","og_type":"article","og_title":"Install Redis on a CentOS\/RHEL\/cPanel Server - Linux Shtuff","og_description":"Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C. It\u2019s a \u201cNoSQL\u201d key-value data store. More precisely, it is a data structure server. To install Redis as daemon on a CentOS\/RHEL\/cPanel server, complete the following steps cd \/usr\/local\/ wget http:\/\/download.redis.io\/releases\/redis-stable.tar.gz tar -xvzf redis-stable.tar.gz cd redis* make... Read More","og_url":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2017-10-11T16:40:47+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Install Redis on a CentOS\/RHEL\/cPanel Server","datePublished":"2017-10-11T16:40:47+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/"},"wordCount":244,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/","url":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/","name":"Install Redis on a CentOS\/RHEL\/cPanel Server - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2017-10-11T16:40:47+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/install-redis-on-a-centosrhelcpanel-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Install Redis on a CentOS\/RHEL\/cPanel Server"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/6823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=6823"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/6823\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=6823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=6823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=6823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}