6

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?

MaxChinni
  • 1,206
  • 14
  • 21

1 Answers1

8

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.
MaxChinni
  • 1,206
  • 14
  • 21