参考:http://zimg.buaa.us/documents/install/
参考:https://blog.csdn.net/sinat_25344949/article/details/80284878
第一步:安装wget
# yum -y install wget
第二步:替换YUM源(国内源aliyun)
# wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
第三步:CentOS7安装zimg依赖包
yum install openssl-devel cmake libevent-devel libjpeg-devel giflib-devel libpng-devel libwebp-devel ImageMagick-devel libmemcached-devel
yum install make gcc gcc-c++ nasm ImageMagick-devel -y
第四步:下载并安装OpenSSL,且建立依赖
wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz
tar zxvf openssl-1.0.1i.tar.gz
cd openssl-1.0.1i
./config shared --prefix=/usr/local --openssldir=/usr/ssl
make && make install
第五步:下载并安装cmake,且建立依赖
wget http://www.cmake.org/files/v3.0/cmake-3.0.1.tar.gz
tar xzvf cmake-3.0.1.tar.gz
cd cmake-3.0.1
./bootstrap --prefix=/usr/local
make && make install
第六步:下载并安装libevent
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar zxvf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable.tar.gz
./configure --prefix=/usr/local
make && make install
第七步:下载并安装libjpeg-turbo,且建立依赖(要构建libjpeg-turbo,您必须先安装nasm)
wget https://downloads.sourceforge.net/project/libjpeg-turbo/1.3.1/libjpeg-turbo-1.3.1.tar.gz
tar zxvf libjpeg-turbo-1.3.1.tar.gz
cd libjpeg-turbo-1.3.1
./configure --prefix=/usr/local --with-jpeg8
make && make install
第八步:WEBP
wget http://downloads.webmproject.org/releases/webp/libwebp-0.4.1.tar.gz
tar zxvf libwebp-0.4.1.tar.gz
cd libwebp-0.4.1
./configure
make
sudo make install
第九步:ImageMagick
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar zxvf ImageMagick.tar.gz
cd ImageMagick-6.9.1-10
./configure --prefix=/usr/local
make && make install
第十步:libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure -prefix=/usr/local
make && make install
第十一步:git下载zimg源码并安装
git clone https://github.com/buaazp/zimg -b master --depth=1
cd zimg
make
第十二步:构建可选的存储后端
memcached(可选)
wget http://www.memcached.org/files/memcached-1.4.19.tar.gz
tar zxvf memcached-1.4.19.tar.gz
cd memcached-1.4.19
./configure --prefix=/usr/local
make
make install
最后:启动
# cd /root/zimg/bin/
# ./zimg -d conf/zimg.lua