1. Download Redis, the latest version is redis-3.2.1.tar.gz
2. Upload to Linux, unzip to/usr/local/below, command: TAR-ZXVF redis-3.2.1.tar.gz
3. We need to authorize redis because we want to use it in an external network and enter the redis.conf file
Modify several configurations: VI redis.conf
A) comment out the native of the binding,
b) Set Redis-service as background service
c) Set the password for the REDIS-CLI connection to the Redis server
d) Exit Save: Command: wq!
4. Start the Redis server, under the Redis directory, Redis-service redis.conf
View process, PS-EF | grep Redis
5.REDIS-CLI the Redis client to connect to the server and test whether it can be connected successfully.
-H is the abbreviation for the host ip,host of the connection,-P is the abbreviation for Port ports, and after-A is the abbreviation for the password (configured after Requirepass) auth
See the 6379 above to indicate the connection was successful.
By entering Ping, the server returns Pong,redis is case-insensitive and exit is quit.
6. How does the extranet test connect to a Redis server, first requiring a firewall to allow Redis Port 6379 to open up.
A) iptables-i INPUT 4-p tcp-m State--state new-m TCP--dport 6379-j ACCEPT
#允许6379端口
b) Service Iptables save #保存iptables规则
c) IPTABLES-NVL view rules for iptables tables
Ps-ef | grep Redis Find the process number of Redis, kill kill-9 PID, restart Redis service, Redis-service redis.conf,
7. On the outside of the computer, cmd--->telnet 121.43.xx.110 space 6379 Note the space, if a black screen appears to indicate that the extranet can access the Redis server
My command is wrong, telnet 121.43.xx.110 6379 IP corresponds to the IP of your Linux host
Here is a simple example of a redis, the code is reference to others, I modified the access to Redis use the password place.
The following code comes from:
Http://www.cnblogs.com/edisonfeng/p/3571870.html
Linux installation Redis and extranet access