Yum安装的nginx模块不全, 有时需要编译安装, 在centos7上编译安装前,需要安装一些依赖包,命令是:
1 |
yum install gcc gcc-c++ pcre pcre-devel openssl openssl-devel gd-devel |
可能会提示pcre已经装过或存在多重版本, 则可以去掉pcre
之后进入Nginx源码目录,进行安装:
1 2 |
./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_image_filter_module --with-http_sub_module --with-http_secure_link_module --with-pcre --with-cc-opt='-O3 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-ld-opt=-Wl,-rpath,/path/to/luajit-or-lua/lib --with-http_stub_status_module --with-stream make && make install |
0 Comments