如何编译Redis,以便可以在共享主机上上传和运行它? [英] How do I compile Redis so that I can upload and run it on shared hosting?

查看:57
本文介绍了如何编译Redis,以便可以在共享主机上上传和运行它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

因此:如何编译Redis,以便可以将其上传到共享托管帐户并在其上运行?

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

推荐答案

我认为最安全的选择是静态编译redis.

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

我刚刚为CentOS 5服务器做了类似的事情.为了100%确定我在工作站上创建了最小的CentOS 5 VM,然后按照以下步骤进行(在CentOS 5 VM上已完成所有操作)

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

  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

  • 安装tcl 8.5

  • install tcl 8.5

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

  • 编译redis

  • compile redis

    make CFLAGS="-static" EXEEXT="-static" LDFLAGS="-I/usr/local/include/"
    

  • 测试redis

  • test redis

    cd src
    ./redis-server
    

  • 将生成的二进制文件复制到目标服务器上.二进制文件可以在 src 文件夹下找到.
  • copy the resulting binaries on the target server. The binaries can be found under the src folder.
  • 这篇关于如何编译Redis,以便可以在共享主机上上传和运行它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆