Introduction to NoSQL (V)

Source: Internet
Author: User
Tags fpm redis server

Introduction to NoSQL (v)

Redis Security Settings

vim /etc/redis.confbind 127.0.0.1 192.168.221.10 //设置监听ipport 10000 //设置监听端口requirepass 123  //设置密码为123rename-command CONFIG apeng //将config命令修改为apengrename-command CONFIG "" //禁掉config命令

Restart Redis Service

killall redis-serverredis-server /etc/redis.conf

Client connection to Redis server

redis-cli -p 10000 -a ‘123‘ -h 127.0.0.1

Redis Slow Query log

vim /etc/redis.confslowlog-log-slower-than 1000 //单位ms,表示慢于1000ms记录日志slowlog-max-len 128 //定义日志长度,表示最多存128条 命令行中的关于慢日志的命令slowlog get  //列出所有的慢查询日志slowlog get 2 //列出最近2条记录slowlog len //查看慢查询日志条数

Using redis--to install the extension module in PHP

cd /usr/local/src/wget https://coding.net/u/aminglinux/p/yuanke_centos7/git/raw/master/21NOSQL/phpredis.zipyum install unzip -yunzip phpredis.zipcd phpredis-develop/yum install autoconf -y/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmakemake installvim /usr/local/php/etc/php.ini //增加extension=redis.so/usr/local/php/bin/php -m|grep redis

Use redis--storage session in PHP (similar to memcached stored session steps)

vim /usr/local/apache2.4/conf/extra/httpd-vhosts.confphp_value session.save_handler "redis"php_value session.save_path "tcp://127.0.0.1:6379"vim /usr/local/php-fpm/etc/php.inisession.save_handler = "redis"session.save_path = "tcp://127.0.0.1:6379"vim /usr/local/php-fpm/etc/php-fpm.d/default.confphp_value[session.save_handler] = redisphp_value[session.save_path] = "tcp://127.0.0.1:6379"

http://blog.51cto.com/13480443/2084481

Introduction to NoSQL (v)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.