Hướng dẫn cài đặt và cấu hình Redis Cache cho Magento
1. Cài đặt Redis
wget
http://dl.fedoraproject.org/pub/epel...6-8.noarch.rpm
rpm -Uvh epel-release-6*.rpm
rpm --import
http://dl.fedoraproject.org/pub/epel...-KEY-EPEL-6yum install redis php-pecl-redis
chkconfig redis on
systemctl enable redis.service
service redis start
service httpd restart
2. Kiểm tra Redis đã running
redis-cli ping
php -m | grep redis
3. Cấu hình Redis
/etc/redis/redis.conf
http://inchoo.net/magento/using-redi...ge-in-magento/
4. Tích hợp Redis vào Magento
cp app/etc/local.xml app/etc/local.xml-bk-$(date +%F)
vi app/etc/local.xml
thêm vào dòng sau:
========================
<cache>
<backend>
Mage_Cache_Backend_Redis</backend>
<backend_options>
<server>127.0.0.1</server> <port>6379</port>
<persistent></persistent>
<password></password>
<force_standalone>0</force_standalone>
<connect_retries>1</connect_retries>
<read_timeout>10</read_timeout>
<automatic_cleaning_factor>0</automatic_cleaning_factor>
<compress_data>1</compress_data>
<compress_tags>1</compress_tags>
<compress_threshold>20480</compress_threshold>
<compression_lib>gzip</compression_lib>
<use_lua>0</use_lua>
</backend_options>
</cache>
=======================
6. Kiểm tra redis đã làm việc với Magento
rm -r /path/magento/var/session/* /path/magento/var/cache/*
echo 'info' | redis-cli -h 127.0.0.1 -p 6379 | grep connections
Tham khảo:
http://hocvps.com/cai-dat-redis-tren-centos/
https://briansnelson.com/Install_Red...ng_for_Magento
http://inchoo.net/magento/using-redi...ge-in-magento/