Forked from coder4web/redis_install_centos.txt
          
        
    
          Last active
          December 23, 2015 11:28 
        
      - 
      
- 
        Save aaronlifton3/6628057 to your computer and use it in GitHub Desktop. 
    updated redis centos install script
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | But today we want to compile redis from source (see http://redis.io/download) | |
| yum install make gcc tcl | |
| cd /usr/local/src | |
| wget http://download.redis.io/releases/redis-2.6.16.tar.gz | |
| tar xzf redis-2.6.16.tar.gz | |
| cd redis-2.6.16 | |
| make | |
| make test | |
| make install | |
| which redis-server | |
| # => /usr/bin/which: no redis-server in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) | |
| Now we add /usr/local/bin to PATH, thanks to http://serverfault.com/questions/102932/adding-a-directory-to-path-in-centos :) | |
| echo 'pathmunge /usr/local/bin' > /etc/profile.d/custom_path.sh | |
| chmod +x /etc/profile.d/custom_path.sh | |
| Add sane configuration into redis, thanks to https://gist.github.com/paulrosania/257849 and http://www.ebrueggeman.com/blog/install-redis-centos-56 :) | |
| mkdir /etc/redis /var/lib/redis | |
| sed -e "s/^daemonize no$/daemonize yes/" -e "s/^dir \.\//dir \/var\/lib\/redis\//" -e "s/^loglevel debug$/loglevel notice/" -e "s/^logfile stdout$/logfile \/var\/log\/redis.log/" redis.conf > /etc/redis/redis.conf | |
| wget https://gist.github.com/paulrosania/257849/raw/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
| sed -i "s/usr\/local\/sbin\/redis/usr\/local\/bin\/redis/" redis-server | |
| chmod u+x redis-server | |
| mv redis-server /etc/init.d | |
| /sbin/chkconfig --add redis-server | |
| /sbin/chkconfig --level 345 redis-server on | |
| /sbin/service redis-server start | |
| # => Starting redis-server: [ OK ] | |
| service redis-server status | |
| # => redis-server (pid NNNN) is running... | |
| Let's test it: | |
| redis-cli | |
| # OR | |
| telnet 127.0.0.1 6379 | |
| set blah:derp "test" | |
| get blah:derp | |
| # => "test" | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment