- CentOS 7.0 Installation script (nginx, php-fpm, redis, postgresql), mainly for laravel
- How to install Redis and Redis php client (Updated: Feb 26, 2016)
- How to Set Up a Redis Server as a Session Handler for PHP on Ubuntu 14.04
- I want to change PHP session handler to redis but it doesn't work for some reason
- CentOS7+PHP7+Nginx+MariaDB+Redisの環境を作る方法
- How do I configure Redis for session handling in a load balanced environment?
- RHEL/CentOS 에 redis 설치
- RHEL/CentOS 에서 PHP 로 redis 연계 하기
- How To Configure a Redis Cluster on CentOS 7
- How to Set Up a Redis Server as a Session Handler for PHP on Ubuntu 16.04
- Redis Start Redis Server 레디스 시작하기
# 설치 확인 php -r "if (new Redis() == true){ echo \"OK \r\n\"; }" # php redis 확인 yum list | egrep "php.*redis" php-nrk-Predis.noarch 1.0.4-1.el7 epel php-pecl-redis.x86_64 2.2.8-1.el7 epel php-phpiredis.x86_64 1.0.0-2.el7 epel php54-php-pecl-redis.x86_64 3.1.1-1.el7.remi remi-safe php54-php-phpiredis.x86_64 1.0.0-1.el7.remi remi-safe php55-php-pecl-redis.x86_64 3.1.1-1.el7.remi remi-safe php55-php-phpiredis.x86_64 1.0.0-1.el7.remi remi-safe php56-php-pecl-redis.x86_64 3.1.1-1.el7.remi remi-safe php56-php-phpiredis.x86_64 1.0.0-1.el7.remi remi-safe php70-php-pecl-redis.x86_64 3.1.1-1.el7.remi remi-safe php70-php-phpiredis.x86_64 1.0.0-1.el7.remi remi-safe php71-php-pecl-redis.x86_64 3.1.1-1.el7.remi remi-safe php71-php-phpiredis.x86_64 1.0.0-2.el7.remi remi-safe # 설치 sudo yum --enablerepo=epel,remi,remi-php70 install -y php-pecl-redis
/etc/php.ini session handler setting
session.save_handler = redis session.save_path = "tcp://127.0.0.1:6379?auth=&database=10"" ; In case you are using queued tracking or Redis as a cache: Make sure to configure a different database! Otherwise queued requests will be flushed ; 멀티서버 설정 ; multiple servers can be configured comma separated ; session.save_path = "tcp://host1:6379?weight=1&database=2, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2"
/etc/php-fpm.d/www.conf
php_value[session.save_handler] = redis php_value[session.save_path] = "tcp://127.0.0.1:6379"
Redis 설치
yum install redis -y systemctl enable redis.service systemctl start redis.service redis-cli ping redis-benchmark -q -n 1000 -c 10 -P 5 tail -f /var/log/redis/redis.log # 경고 내용확인 # /etc/sysctl.conf 관련 메세지 vi /etc/sysctl.conf # vm.overcommit_memory = 1 # 내용 추가 후 저장 # sysctl vm.overcommit_memory=1 sysctl vm.overcommit_memory=1 # echo never > /sys/kernel/mm/transparent_hugepage/enabled 관련 메세지 cat /sys/kernel/mm/transparent_hugepage/enabled # [always] madvise never echo never > /sys/kernel/mm/transparent_hugepage/enabled cat /sys/kernel/mm/transparent_hugepage/enabled # always madvise [never] # reboot 후에 실행 되도록 설정 vi /etc/rc.local echo never > /sys/kernel/mm/transparent_hugepage/enabled # /proc/sys/net/core/somaxconn 관련 메세지 sysctl -w net.core.somaxconn=65535 # Increased maximum number of open files to 10032 (it was originally set to 1024). 메세지 # /etc/security/limits.conf 내용 추가 vi /etc/security/limits.conf #{username} soft nofile 65536 redis soft nofile 65536 redis hard nofile 65536 redis soft nproc 131072 redis hard nproc 131072 reboot # 보안해제 firewall-cmd --zone=public --permanent --add-port=6379/tcp
/etc/redis.conf
requirepass {레디스비밀번호}
반응형
'lang > php' 카테고리의 다른 글
CI 2.6 에서 redis 캐시드라이브 (0) | 2017.03.20 |
---|---|
PHP 병렬처리 (0) | 2017.03.17 |
Centos7 Nginx+php7+php-fpm (0) | 2017.02.21 |
php7.1 mcrypt_get_iv_size Error (0) | 2017.02.17 |
CI hwp 파일 업로드 (unknown file extension upload), 다운로드 (0) | 2016.07.02 |