Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
redis_unix_socket [2018/01/20 21:45] qtwrk [for Centos 7.X] |
redis_unix_socket [2018/01/22 12:08] qtwrk [for Centos 7.X] |
||
---|---|---|---|
Line 1: | Line 1: | ||
How to use Redis in a UNIX socket | How to use Redis in a UNIX socket | ||
+ | |||
+ | Please use root privilege to execute the following instructions. | ||
+ | If Redis fails to start , please verify SELinux is disabled , and all mentioned directories and files have correct permissions to the designated user. | ||
+ | |||
=====for Centos 7.X===== | =====for Centos 7.X===== | ||
- | - Stop redis <code>systemctl stop redis</code> | + | 1. Stop redis <code>systemctl stop redis</code> |
- | - Copy the service file | + | 2. Copy the service file |
<code>cp /usr/lib/systemd/system/redis.service /etc/systemd/system/redis.service</code> | <code>cp /usr/lib/systemd/system/redis.service /etc/systemd/system/redis.service</code> | ||
- | - edit ''/etc/systemd/system/redis.service'' | + | 3. Edit ''/etc/systemd/system/redis.service'' |
Line 19: | Line 23: | ||
change ''username'' to same user that runs PHP | change ''username'' to same user that runs PHP | ||
- | - edit ''/etc/redis.conf'' | + | 4. Edit ''/etc/redis.conf'' |
change following | change following | ||
Line 33: | Line 37: | ||
- | change owner of redis.conf to same username in step 3 | + | 5. Change owner of redis.conf to same username in step 3 |
<code>chown username:group /etc/redis.conf</code> | <code>chown username:group /etc/redis.conf</code> | ||
Line 40: | Line 44: | ||
- | - now start redis. | + | 6. Now start redis. |
<code>systemctl start redis</code> | <code>systemctl start redis</code> | ||
- | - Verify it started successfully: | + | 7. Verify it started successfully: |
<code>systemctl status redis</code> | <code>systemctl status redis</code> | ||
- | - Check if everything is working well: | + | 8. Check if everything is working well: |
<code>nc -U /path/to/redis.sock | <code>nc -U /path/to/redis.sock |