Setting up Redis on Webfaction

后端 未结 3 855
暗喜
暗喜 2021-01-29 20:19

What are the steps required to set up Redis database on Webfaction shared hosting account?

3条回答
  •  我在风中等你
    2021-01-29 20:59

    To summarize Akseli's excellent answer:

    assume your user is named "magic_r_user"
    
    cd ~
    wget "http://download.redis.io/releases/redis-3.0.0.tar.gz"
    tar -xzf redis-3.0.0.tar.gz
    mv redis-3.0.0 redis
    cd redis
    make
    make test
    create a custom app "listening on port" through the Webfaction management website
        assume we named it magic_r_app
        assume it was assigned port 18932
    cp ~/redis/redis.conf ~/webapps/magic_r_app/
    vi ~/webapps/magic_r_app/redis.conf
        daemonize yes   
        pidfile ~/webapps/magic_r_app/redis.pid
        port 18932
    test it
        ~/redis/src/redis-server ~/webapps/magic_r_app/redis.conf
        ~/redis/src/redis-cli -p 18932
        ctrl-d
        cat ~/webapps/magic_r_app/redis.pid | xargs kill
    crontab -e
        */1 * * * * /home/magic_r_user/redis/src/redis-server /home/magic_r_user/webapps/magic_r_app/redis.conf &>> /home/magic_r_user/logs/user/cron.log
    don't forget to set a password!
    

提交回复
热议问题