本文共 7481 字,大约阅读时间需要 24 分钟。
跟上回差不多,去掉了GeoIP模块,除了做外贸网站,一般用不到。
集成的第三方模块
google perf tool
naxsi
upstream url hash
cache purge
详见附件,去掉.zip后缀名即可
另外,还有一个编译包,添加了最新的google的ngx_pagespeed模块,那家伙比较大,这里只提供spec文件
#%define nginx_home %{_localstatedir}/cache/nginx%define nginx_user nginx%define nginx_group nginxSummary: nginx is a high performance web serverName: nginxVersion: 1.4.4Release: 2%{?dist}.pagespeedVendor: nginx inc.URL: http://nginx.org/Source0: http://nginx.org/download/%{name}-%{version}.tar.gzSource1: logrotateSource2: nginx.initSource3: nginx.sysconfSource4: nginx.confSource5: nginx.vh.default.confSource6: nginx.vh.example_ssl.confSource7: nginx.suse.initSource8: fastcgi_paramsSource50: ngx_pagespeed-1.7.30.1-beta.tar.gzSource51: pagespeed.confLicense: 2-clause BSD-like license%if 0%{?suse_version}Group: Productivity/Networking/Web/Servers%elseGroup: System Environment/Daemons%endifBuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-rootBuildRequires: zlib-develBuildRequires: pcre-develBuildRequires: perlBuildRequires: gperftools-develBuildRequires: gcc-c++%if 0%{?suse_version}BuildRequires: libopenssl-develRequires(pre): pwdutils%elseBuildRequires: openssl-develRequires: initscripts >= 8.36Requires(pre): shadow-utilsRequires(post): chkconfig%endifProvides: webserver%descriptionnginx [engine x] is an HTTP and reverse proxy server, as well asa mail proxy server%package debugSummary: debug version of nginxGroup: System Environment/DaemonsRequires: nginx%description debugnot stripped version of nginx build with the debugging log support%prep%setup -q%{__tar} zxvf %{SOURCE50}%build./configure \ --prefix=%{_sysconfdir}/nginx \ --sbin-path=%{_sbindir}/nginx \ --conf-path=%{_sysconfdir}/nginx/nginx.conf \ --error-log-path=%{_localstatedir}/log/nginx/error.log \ --http-log-path=%{_localstatedir}/log/nginx/access.log \ --pid-path=%{_localstatedir}/run/nginx.pid \ --lock-path=%{_localstatedir}/run/nginx.lock \ --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp \ --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp \ --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp \ --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp \ --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp \ --user=%{nginx_user} \ --group=%{nginx_group} \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-google_perftools_module \ --add-module=ngx_pagespeed-1.7.30.1-beta \ --with-file-aio \ --with-debug \ --with-cc-opt="%{optflags} $(pcre-config --cflags)" \ $*make %{?_smp_mflags}%{__mv} %{_builddir}/%{name}-%{version}/objs/nginx \ %{_builddir}/%{name}-%{version}/objs/nginx.debug./configure \ --prefix=%{_sysconfdir}/nginx \ --sbin-path=%{_sbindir}/nginx \ --conf-path=%{_sysconfdir}/nginx/nginx.conf \ --error-log-path=%{_localstatedir}/log/nginx/error.log \ --http-log-path=%{_localstatedir}/log/nginx/access.log \ --pid-path=%{_localstatedir}/run/nginx.pid \ --lock-path=%{_localstatedir}/run/nginx.lock \ --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp \ --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp \ --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp \ --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp \ --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp \ --user=%{nginx_user} \ --group=%{nginx_group} \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-file-aio \ --with-google_perftools_module \ --add-module=ngx_pagespeed-1.7.30.1-beta \ --with-cc-opt="%{optflags} $(pcre-config --cflags)" \ $*make %{?_smp_mflags}%install%{__rm} -rf $RPM_BUILD_ROOT%{__make} DESTDIR=$RPM_BUILD_ROOT install%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/nginx%{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/html $RPM_BUILD_ROOT%{_datadir}/nginx/%{__rm} -f $RPM_BUILD_ROOT%{_sysconfdir}/nginx/*.default%{__rm} -f $RPM_BUILD_ROOT%{_sysconfdir}/nginx/fastcgi.conf%{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/log/nginx%{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/run/nginx%{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/cache/nginx%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/nginx.conf%{__install} -m 644 -p %{SOURCE4} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/nginx.conf%{__install} -m 644 -p %{SOURCE5} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/default.conf%{__install} -m 644 -p %{SOURCE6} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/example_ssl.conf%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig%{__install} -m 644 -p %{SOURCE3} \ $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/nginx%{__install} -m 644 -p %{SOURCE8} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/fastcgi_params%{__install} -m 644 -p %{SOURCE51} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/pagespeed.conf# install SYSV init stuff%{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir}%if 0%{?suse_version}%{__install} -m755 %{SOURCE7} \ $RPM_BUILD_ROOT%{_initrddir}/nginx%else%{__install} -m755 %{SOURCE2} \ $RPM_BUILD_ROOT%{_initrddir}/nginx%endif# install log rotation stuff%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d%{__install} -m 644 -p %{SOURCE1} \ $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/nginx%{__install} -m644 %{_builddir}/%{name}-%{version}/objs/nginx.debug \ $RPM_BUILD_ROOT%{_sbindir}/nginx.debug%clean%{__rm} -rf $RPM_BUILD_ROOT%files%defattr(-,root,root)%{_sbindir}/nginx%dir %{_sysconfdir}/nginx%dir %{_sysconfdir}/nginx/conf.d%config(noreplace) %{_sysconfdir}/nginx/nginx.conf%config(noreplace) %{_sysconfdir}/nginx/conf.d/default.conf%config(noreplace) %{_sysconfdir}/nginx/conf.d/example_ssl.conf%config(noreplace) %{_sysconfdir}/nginx/mime.types%config(noreplace) %{_sysconfdir}/nginx/fastcgi_params%config(noreplace) %{_sysconfdir}/nginx/scgi_params%config(noreplace) %{_sysconfdir}/nginx/uwsgi_params%config(noreplace) %{_sysconfdir}/nginx/koi-utf%config(noreplace) %{_sysconfdir}/nginx/koi-win%config(noreplace) %{_sysconfdir}/nginx/win-utf%config(noreplace) %{_sysconfdir}/nginx/pagespeed.conf%config(noreplace) %{_sysconfdir}/logrotate.d/nginx%config(noreplace) %{_sysconfdir}/sysconfig/nginx%{_initrddir}/nginx%dir %{_datadir}/nginx%dir %{_datadir}/nginx/html%{_datadir}/nginx/html/*%attr(0755,root,root) %dir %{_localstatedir}/cache/nginx%attr(0755,root,root) %dir %{_localstatedir}/log/nginx%files debug%attr(0755,root,root) %{_sbindir}/nginx.debug%pre# Add the "nginx" usergetent group %{nginx_group} >/dev/null || groupadd -r %{nginx_group}getent passwd %{nginx_user} >/dev/null || \ useradd -r -g %{nginx_group} -s /sbin/nologin \ -d %{nginx_home} -c "nginx user" %{nginx_user}exit 0%post# Register the nginx serviceif [ $1 -eq 1 ]; then /sbin/chkconfig --add nginx # print site info cat </dev/null 2>&1 /sbin/chkconfig --del nginxfi%postunif [ $1 -ge 1 ]; then /sbin/service nginx upgrade &>/dev/null || :fi%changelog* Sat Nov 23 2013 Purple Grape - update to 1.4.4- google_perftools_module add- ngx_pagespeed module add
最后更新 2013-11-23
升级到nginx1.4.4,添加一个包含ngx_pagespeed模块的spec文件
转载地址:http://ygqzx.baihongyu.com/