Install CentOS6.5 instance in Redis in PHP development

Source: Internet
Author: User
This article describes how to install CentOS6.5 in Redis in PHP Development. 1. install Redis.

 1 wget http://download.redis.io/releases/redis-3.2.8.tar.gz  2 tar xzf redis-3.2.8.tar.gz   3 cd redis-3.2.8  4 make 5  6 cd src   7 cp redis-server /usr/local/bin/   8 cp redis-cli /usr/local/bin/ 9 10 mkdir /etc/redis  11 mkdir /var/redis  12 mkdir /var/redis/637913 cd ../14 cp utils/redis_init_script15 cp redis.conf /etc/redis/6379.conf16 vim /etc/redis/6379.conf

Vim/etc/redis/6379. conf, find the following code and modify

daemonize to yes  pidfile to /var/run/redis_6379.pid  logfile to /var/log/redis_6379.log  dir to /var/redis/6379  maxmemory 268435456

Maxmemory is set to 256 mb. you can set it according to your configuration. Set start: vim/etc/rc. d/rc. local, add the following code

/etc/init.d/redis_6379 start 

2. install Redis extension

yum install gitgit clone git://github.com/owlient/phprediscd phpredis/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make install

3. add extension = redis. so to php. ini.

4. Add password protection to Redis.

First, based on security considerations, we need to set a password for redis unless your redis port is closed.
Vim/etc/redis/6379. conf
Find the line and remove the front #, followed by the redis password
Requirepass rds423fsadD
Restart redis.
/Etc/init. d/redis_6379 stop

The above is the details of the instance where CentOS6.5 is installed in Redis in PHP Development. For more information, see other related articles in the first PHP community!

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.