How do I compile Redis so that I can upload and run it on shared hosting?

*爱你&永不变心* 提交于 2021-01-22 14:39:32

问题


I need to run Redis on my shared hosting account, but I am unable to compile on the server because of the nature of shared hosting. I have SSH access, but my hosting provider told me that I would need to compile Redis first and then upload it to the server.

I'm not sure how to go about this, and the only other person that asked this question on here never got a response.

So: how do I compile Redis so that I can upload it to and run it on my shared hosting account?


回答1:


In my opinion the safest bet would be to statically compile redis.

I just did something similar for a CentOS 5 server. To be 100% sure I created a minimal CentOS 5 VM on my workstation, then I followed these steps (everything has been done on the CentOS 5 VM)

  1. download redis and tcl 8.5

    wget http://download.redis.io/releases/redis-3.0.2.tar.gz
    wget http://prdownloads.sourceforge.net/tcl/tcl8.5.18-src.tar.gz
    
  2. install tcl 8.5

    tar xfz tcl8.5.18-src.tar.gz
    cd tcl8.5.18/unix
    ./configure
    make
    make test
    make install
    
  3. compile redis

    make CFLAGS="-static" EXEEXT="-static" LDFLAGS="-I/usr/local/include/"
    
  4. test redis

    cd src
    ./redis-server
    
  5. copy the resulting binaries on the target server. The binaries can be found under the src folder.


来源:https://stackoverflow.com/questions/25732783/how-do-i-compile-redis-so-that-i-can-upload-and-run-it-on-shared-hosting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!