如何编译Redis以便我可以在共享主机上传和运行它?

时间:2023-01-31 20:23:16

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.

我需要在我的共享主机帐户上运行Redis,但由于共享主机的性质,我无法在服务器上进行编译。我有SSH访问权限,但我的托管服务提供商告诉我,我需要先编译Redis然后将其上传到服务器。

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?

那么:我如何编译Redis以便我可以将其上传到我的共享主机帐户并在其上运行?

1 个解决方案

#1


3  

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

在我看来,最安全的赌注是静态编译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)

我刚刚为CentOS 5服务器做了类似的事情。为了100%确定我在我的工作站上创建了一个最小的CentOS 5 VM,然后我按照这些步骤(一切都在CentOS 5 VM上完成)

  1. download redis and tcl 8.5

    下载redis和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

    安装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

    编译redis

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

    测试redis

    cd src
    ./redis-server
    
  5. copy the resulting binaries on the target server. The binaries can be found under the src folder.
  6. 在目标服务器上复制生成的二进制文件。二进制文件可以在src文件夹下找到。

#1


3  

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

在我看来,最安全的赌注是静态编译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)

我刚刚为CentOS 5服务器做了类似的事情。为了100%确定我在我的工作站上创建了一个最小的CentOS 5 VM,然后我按照这些步骤(一切都在CentOS 5 VM上完成)

  1. download redis and tcl 8.5

    下载redis和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

    安装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

    编译redis

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

    测试redis

    cd src
    ./redis-server
    
  5. copy the resulting binaries on the target server. The binaries can be found under the src folder.
  6. 在目标服务器上复制生成的二进制文件。二进制文件可以在src文件夹下找到。