(1) Go to the/usr/local directory.
CD/usr/local
If there is no local folder, create
Sudo mkdir/usr/local
Sudo chmod 777/usr/local
(2) download redis
Wget http://download.redis.io/releases/redis-2.8.12.tar.gz
Extract
Tar zxvf redis-2.8.12.tar.gz
Rename to: redis2.8
Music redis-2.8.12 redis2.8
(3) Compile,
CD/usr/local/redis2.8
Make
(4) check whether the compilation is successful
CD/usr/local/redis2.8/src
Make Test
If the following error is prompted, it is because Tcl is not installed.
You need TCL 8.5 or newer in order to run the redis Test
Make: *** [test] Error 1
Download and install Tcl in the/usr/local directory.
CD/usr/local
Wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
Extract
Tar zxvf tcl8.6.1-src.tar.gz
After decompression, compile
CD tcl8.6.1/Unix
./Configure
Make
Make install
After Tcl is installed, check whether the compilation is successful.
CD/usr/local/redis2.8
CD SRC
Make Test
If the result is as follows, the compilation is successful.
\ O/all tests passed without errors!
Cleanup: may take some time... OK
(5) Installation
CD/usr/local/redis2.8/src
Make install
(6) default directory of the redis command:/usr/local/bin/
Download the configuration file and startup script
Wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server
Wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf
Sudo MV redis-server/etc/init. d/redis-Server
Sudo chmod + x/etc/init. d/redis-Server
Sudo MV redis. CONF/etc/redis. conf
Create a user redis and create a new data and log folder
Sudo useradd redis
Sudo mkdir-P/var/lib/redis
Sudo mkdir-P/var/log/redis
Sudo chown redis. redis/var/lib/redis
Sudo chown redis. redis/var/log/redis
Set automatic start upon startup
Sudo update-rc.d redis-server defaults
Start redis
Sudo/etc/init. d/redis-Server start