[iyunv@localhost opt]# cd lloyd-yajl-12ee82a/
[iyunv@localhost lloyd-yajl-12ee82a]# ./configure --prefix=/usr/local/yajl && make && make install
报错
== removing old build files
== running CMake in build directory
./configure: line 41: cmake: command not found
The "cmake" program is required to configure yajl.
It's available from most ports/packaging systems and http://cmake.org
解决办法:
yum -y install cmake
继续编译通过
下载tengine此软件是nginx的升华版本,在nginx上二次开发
wget http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
下载nginx-tfs模块
wget https://codeload.github.com/alibaba/nginx-tfs/zip/master
安装tengine并添加ngix-tfs模块
[iyunv@localhost tengine-2.0.3]# ./configure --prefix=/usr/local/nginx --add-module=/opt/nginx-tfs-master && make && make install
报错
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决办法
[iyunv@localhost tengine-2.0.3]# yum -y install pcre-devel
继续编译tengine
[iyunv@localhost tengine-2.0.3]# ./configure --prefix=/usr/local/nginx --add-module=/opt/nginx-tfs-master && make && make install
启动nginx报错
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libyajl.so.2: cannot open shared object file: No such file or directory
xx解决办法
[iyunv@localhost tengine-2.0.3]# ln -s /usr/local/lib/libyajl.so.2 /usr/lib64/libyajl.so.2
再次测试成功
启动nginx
[iyunv@localhost tengine-2.0.3]# /usr/local/nginx/sbin/nginx
8.使用nginx访问上传图片路径
修改nginx配置文件
在nginx的http模块中添加upstream
tfs_upstream tfs_ns {
server 192.168.1.230:8108;
type ns;
}
在nginx的server模块中添加tfs_pass
server {
listen 80;
server_name localhost;
tfs_keepalive max_cached=100 bucket_count=10;
tfs_log "pipe:/usr/sbin/cronolog -p 30min /var/log/nginx/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";