前几章写的Nginx +Keepalived集群搭建添加链接描述
没有明确nginx编译的内容,只是简单的编译了,没有带相应的参数,相关同学和我反馈,说在部署应用的时候回出现错误,那这里补下编译的参数内容
./configure --prefix=/data/nginx --sbin-path=/data/nginx/sbin/nginx --conf-path=/data/nginx/conf/nginx.conf --error-log-path=/data/nginx/log/error.log --http-log-path=/data/nginx/log/access.log --pid-path=/data/nginx/log/pid/nginx.pid --lock-path=/data/nginx/log/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-ld-opt="-Wl,-E" --with-http_image_filter_module
注意,编译的时候可能会报错,不要怕,报的错多为缺少相应的依赖包,只需要执行安装依赖包就可以。另外,这里编译的路径是/data,请务必注意!!!!
例如:
问题1:./configure: error: perl module ExtUtils::Embed is required
原因:
缺少perl-ExtUtils-Embed
解决方法:
yum install -y perl-ExtUtils-Embed
问题2:./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
原因:
缺少
gd-devel
解决方法:
yum install -y gd-devel