????? Redis website address:http://www.redis.io/
???? Latest Version: 2.8.3
???? in the Linux under Installation Redis very simple, the specific steps are as follows (the official website is explained):
???? 1 , download the source code, unzip and compile the source code.
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzf redis-2.8. 3. tar.gz
$ cd redis-2.8. 3
$ make
???? 2 , after the compilation is complete, SRC directory, there are four executable files Redis-server , Redis-benchmark , redis-cli and the redis.conf . And then copy it to a directory.
Mkdir/usr/redis
CP Redis-server/usr/redis
CP Redis-benchmark/usr/redis
CP Redis-cli/usr/redis
CP Redis.conf/usr/redis
Cd/usr/redis
???? 3 , start Redis service.
$ redis-server redis.conf
????? 4, then use the client to test whether to start successfully.
$ redis-cli
redis> set foo bar
Ok
redis> get foo
"Bar"
?
?
?
?
If the installation process occurs (refer to :http://blog.csdn.net/luyee2010/article/details/ 18766911)
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz-c/usr/local/
cd/usr/local/tcl8.6.1/unix/
sudo./configure
sudo make
sudo make install
?
?
?
[HTML]? View Plain Copy
- Vi?/etc/redis.conf??
- # Find Daemonize?no instead ??
- # run in daemon mode ??
- Daemonize?yes??
- # Modify dir?. / for absolute path ,??
- # Default Words Redis-server generated or read in the current directory at startup Dump.rdb??
- # so if you execute it under the root directory redis-server?/etc/redis.conf words ,??
- # is read from the root directory. Dump.rdb, to make Redis-server can be executed in any directory ??
- # so here will dir change to Absolute path ??
- Dir?/usr/local/redis??
- # Modify appendonly to be yes??
- # Specifies whether to log records after each update operation, ??
- #Redis asynchronously writes data to disk by default. ??
- # if it is not turned on, it may result in loss of data over a period of time when power is lost. ??
- # because ? Redis the sync data file itself is pressed above Save conditions to synchronize, ??
- # so some data will only exist in memory for a period of time. Default is no??
- Appendonly?yes??
- # will be Redis add to self-launch ??
- Echo? " /usr/local/bin/redis-server?/etc/redis.conf "? >>/etc/rc.d/rc.local??
- # Start Redis??
- Redis-server?/etc/redis.conf??
- # View Redis is it started ? ??
- Ps?-ef?|? Grep?redis??
2> "Open Redis Port "
[HTML]? View Plain Copy
- # shutting down the firewall ??
- Service?iptables?stop??
- Vi?/etc/sysconfig/iptables??
- # Add ??
- -A? Input?-m?state?--state? New?-m?tcp?-p?tcp?--dport?6379?-j? ACCEPT??
- # Restarting the firewall ??
- Service?iptables?restart??
3> the installation Phpredis extension "
[HTML]? View Plain Copy
- Tar?-zxvf?owlient-phpredis-2.1.1-1-g90ecd17.tar.gz??
- Cd?owlient-phpredis-90ecd17??
- /usr/local/php/bin/phpize??
- ./configure? --with-php-config=/usr/local/php/bin/php-config??
- Make??
- Make?install??
- # after executing Make?install is generated after the ??
- #Installing? Shared?extensions:????? /usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/??
- # Modify php.ini??
- Vi?/usr/local/php/etc/php.ini??
- # Find Extension_dir, modified to ??
- Extension_dir? =?" /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"??
- # Add Redis??
- Extension? =? Redis. So??
- # Restart Apache??
- Service?httpd?restart??
Redis installation and use under Linux