In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
System AliyunLinux
Install Redis (I installed redis under / alidata/server/redis)
Go to http://redis.io/download to download redis and transfer it to the server with the FTP tool or follow the steps written on the redis official website to operate wget http://download.redis.io/releases/redis-2.8.18.tar.gz// download tar xzf redis-2.8.18.tar.gz// extract cd redis-2.8.18 make// compilation
2. Configure Redis
Cp redis.conf / etc/redis.conf# copy a redis configuration file to the etc directory open the redis configuration file vi / etc/redis.conf modify whether daemonize yes# runs as a daemon dir / var/lib/redis/ cache storage location useradd redis# add redis user mkdir-p / var/lib/redis# create db folder chown redis.redis / var/lib/redis# db file here
Edit the startup script (found on the Internet)
# description: Start and Stop redis PATH=/usr/local/bin:/sbin:/usr/bin:/bin REDISPORT=6379 EXEC=/alidata/server/redis-2.8.18/src/redis-server REDIS_CLI=/alidata/server/redis-2.8.18/src/redis-cli PIDFILE=/var/run/redis.pid CONF= "/ etc/redis.conf" case "$1" in start) if [- f $PIDFILE] then echo "$PIDFILE exists, process is already running or crashed." Else echo "Starting Redis server..." $EXEC $CONF fi if ["$?" = "0"] then echo "Redis is running..." Fi; stop) if [!-f $PIDFILE] then echo "$PIDFILE exists, process is not running." Else PID=$ (cat $PIDFILE) echo "Stopping..." $REDIS_CLI-p $REDISPORT-a $AUTH SHUTDOWN sleep 2 while [- x $PIDFILE] do echo "Waiting for Redis to shutdown..." Sleep 1 done echo "Redis stopped" fi;; restart | force-reload) ${0} stop ${0} start;; *) echo "Usage: / etc/init.d/redis {start | stop | restart | force-reload}" > & 2 exit 1 esac
4. Add boot entry
Vi / etc/rc.d/rc.local
Increase
/ etc/init.d/redis start
5. Testing
Create a php file in your site directory
$redis = new Redis (); $redis- > connect ('127.0.0.1, 6379); $redis- > set (' test', '11111'); echo $redis- > get (' test')
All right, this is the end of the configuration of the redis, because my novice is also in the groping configuration, if there is something wrong, welcome to correct, grateful!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.