问题
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)
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
install tcl 8.5
tar xfz tcl8.5.18-src.tar.gz cd tcl8.5.18/unix ./configure make make test make install
compile redis
make CFLAGS="-static" EXEEXT="-static" LDFLAGS="-I/usr/local/include/"
test redis
cd src ./redis-server
- 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