commit c0814984931d26f05e5aba45d90efaf024adb359
Author: Jeremy Hinegardner <jeremy(a)hinegardner.org>
Date: Sun Oct 31 16:31:41 2010 -0600
Update to the new stable branch 0.8.53
Normally this update would not have take place, but the 0.6.x branch
of code in nginx itself has been deprecated and will no longer be
supported.
.gitignore | 8 ++++-
nginx-cve-2009-3555.patch | 87 ---------------------------------------------
nginx-upstream-fair.tgz | Bin 6824 -> 0 bytes
nginx.conf | 21 +++++------
nginx.init | 56 ++++++++++++++++++++--------
nginx.spec | 71 +++++++++++++++++++++---------------
sources | 2 +-
upstream-fair.conf | 18 ---------
8 files changed, 99 insertions(+), 164 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3e9df11..933f040 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,7 @@
-nginx-0.6.39.tar.gz
+nginx-0.8.53.tar.gz
+*~
+nginx*/
+x86_64/
+.*.log
+*swp
+*.rpm
diff --git a/nginx.conf b/nginx.conf
index 078c0a4..f3dc403 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -3,7 +3,7 @@
# This is the main Nginx configuration file.
#
# More information about the configuration options is available on
-# * the English wiki -
http://wiki.codemongers.com/Main
+# * the English wiki -
http://wiki.nginx.org/Main
# * the Russian documentation -
http://sysoev.ru/nginx/
#
#######################################################################
@@ -11,25 +11,24 @@
#----------------------------------------------------------------------
# Main Module - directives that cover basic functionality
#
-#
http://wiki.codemongers.com/NginxMainModule
+#
http://wiki.nginx.org/NginxHttpMainModule
#
#----------------------------------------------------------------------
user nginx;
worker_processes 1;
-error_log /var/log/nginx/error.log;
-#error_log /var/log/nginx/error.log notice;
-#error_log /var/log/nginx/error.log info;
-
-pid /var/run/nginx.pid;
+error_log /var/log/nginx/error.log;
+#error_log /var/log/nginx/error.log notice;
+#error_log /var/log/nginx/error.log info;
+pid /var/run/nginx.pid;
#----------------------------------------------------------------------
# Events Module
#
-#
http://wiki.codemongers.com/NginxEventsModule
+#
http://wiki.nginx.org/NginxHttpEventsModule
#
#----------------------------------------------------------------------
@@ -41,7 +40,7 @@ events {
#----------------------------------------------------------------------
# HTTP Core Module
#
-#
http://wiki.codemongers.com/NginxHttpCoreModule
+#
http://wiki.nginx.org/NginxHttpCoreModule
#
#----------------------------------------------------------------------
@@ -49,8 +48,8 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] $request '
- '"$status" $body_bytes_sent "$http_referer"
'
+ log_format main '$remote_addr - $remote_user [$time_local] "$request"
'
+ '$status $body_bytes_sent "$http_referer" '
'"$http_user_agent"
"$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
diff --git a/nginx.init b/nginx.init
index 6ba302d..670fca5 100644
--- a/nginx.init
+++ b/nginx.init
@@ -1,8 +1,8 @@
#!/bin/sh
#
-# nginx - this script starts and stops the nginx daemin
+# nginx - this script starts and stops the nginx daemon
#
-# chkconfig: - 85 15
+# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
@@ -49,27 +49,26 @@ stop() {
}
restart() {
- configtest || return $?
+ configtest_q || configtest || return 6
stop
start
}
reload() {
- configtest || return $?
+ configtest_q || configtest || return 6
echo -n $"Reloading $prog: "
killproc $nginx -HUP
- RETVAL=$?
echo
}
-force_reload() {
- restart
-}
-
configtest() {
$nginx -t -c $NGINX_CONF_FILE
}
+configtest_q() {
+ configtest >/dev/null 2>&1
+}
+
rh_status() {
status $prog
}
@@ -78,6 +77,29 @@ rh_status_q() {
rh_status >/dev/null 2>&1
}
+# Upgrade the binary with no downtime.
+upgrade() {
+ local pidfile="/var/run/${prog}.pid"
+ local oldbin_pidfile="${pidfile}.oldbin"
+
+ configtest_q || configtest || return 6
+ echo -n $"Staring new master $prog: "
+ killproc $nginx -USR2
+ retval=$?
+ echo
+ sleep 1
+ if [[ -f ${oldbin_pidfile} && -f ${pidfile} ]]; then
+ echo -n $"Graceful shutdown of old $prog: "
+ killproc -p ${oldbin_pidfile} -QUIT
+ retval=$?
+ echo
+ return 0
+ else
+ echo $"Something bad happened, manual intervention required, maybe
restart?"
+ return 1
+ fi
+}
+
case "$1" in
start)
rh_status_q && exit 0
@@ -90,20 +112,22 @@ case "$1" in
restart|configtest)
$1
;;
+ force-reload|upgrade)
+ rh_status_q || exit 7
+ upgrade
+ ;;
reload)
rh_status_q || exit 7
$1
;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
+ status|status_q)
+ rh_$1
;;
condrestart|try-restart)
- rh_status_q || exit 0
+ rh_status_q || exit 7
+ restart
;;
*)
- echo $"Usage: $0
{start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
+ echo $"Usage: $0
{start|stop|reload|configtest|status|force-reload|upgrade|restart}"
exit 2
esac
diff --git a/nginx.spec b/nginx.spec
index 103d22d..2d52df8 100644
--- a/nginx.spec
+++ b/nginx.spec
@@ -8,9 +8,9 @@
%define nginx_webroot %{nginx_datadir}/html
Name: nginx
-Version: 0.6.39
-Release: 5%{?dist}
-Summary: Robust, small and high performance http and reverse proxy server
+Version: 0.8.53
+Release: 1%{?dist}
+Summary: Robust, small and high performance HTTP and reverse proxy server
Group: System Environment/Daemons
# BSD License (two clause)
@@ -19,8 +19,9 @@ License: BSD
URL:
http://nginx.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: pcre-devel,zlib-devel,openssl-devel,perl(ExtUtils::Embed)
-Requires: pcre,zlib,openssl
+BuildRequires: pcre-devel,zlib-devel,openssl-devel,perl-devel,perl(ExtUtils::Embed)
+BuildRequires: libxslt-devel,GeoIP-devel,gd-devel
+Requires: pcre,zlib,openssl,GeoIP,gd
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo
$version))
# for /usr/sbin/useradd
Requires(pre): shadow-utils
@@ -28,16 +29,15 @@ Requires(post): chkconfig
# for /sbin/service
Requires(preun): chkconfig, initscripts
Requires(postun): initscripts
+Provides: webserver
Source0:
http://sysoev.ru/nginx/nginx-%{version}.tar.gz
Source1: %{name}.init
Source2: %{name}.logrotate
Source3: virtual.conf
Source4: ssl.conf
-Source5: nginx-upstream-fair.tgz
-Source6: upstream-fair.conf
-Source7: %{name}.sysconfig
-Source8: %{name}.conf
+Source5: %{name}.sysconfig
+Source6: nginx.conf
Source100: index.html
Source101: poweredby.png
Source102: nginx-logo.png
@@ -48,22 +48,14 @@ Source104: 404.html
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
Patch0: nginx-auto-cc-gcc.patch
-#patch for
http://www.kb.cert.org/vuls/id/120541
-Patch1: nginx-cve-2009-3555.patch
-
-
%description
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
proxy server written by Igor Sysoev.
-One third party module, nginx-upstream-fair, has been added.
-
%prep
%setup -q
%patch0 -p0
-%patch1 -p0
-%{__tar} zxvf %{SOURCE5}
%build
# nginx does not utilize a standard configure script. It has its own
@@ -83,27 +75,33 @@ export DESTDIR=%{buildroot}
--http-client-body-temp-path=%{nginx_home_tmp}/client_body \
--http-proxy-temp-path=%{nginx_home_tmp}/proxy \
--http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
+ --http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \
+ --http-scgi-temp-path=%{nginx_home_tmp}/scgi \
--pid-path=%{_localstatedir}/run/%{name}.pid \
--lock-path=%{_localstatedir}/lock/subsys/%{name} \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
+ --with-http_xslt_module \
+ --with-http_image_filter_module \
+ --with-http_geoip_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gzip_static_module \
+ --with-http_random_index_module \
+ --with-http_secure_link_module \
+ --with-http_degradation_module \
--with-http_stub_status_module \
--with-http_perl_module \
--with-mail \
+ --with-file-aio \
--with-mail_ssl_module \
+ --with-ipv6 \
--with-cc-opt="%{optflags} $(pcre-config --cflags)" \
- --add-module=%{_builddir}/nginx-%{version}/nginx-upstream-fair
+ --with-cc-opt="%{optflags} $(pcre-config --cflags)"
make %{?_smp_mflags}
-# rename the readme for nginx-upstream-fair so it doesn't conflict with the main
-# readme
-mv nginx-upstream-fair/README nginx-upstream-fair/README.nginx-upstream-fair
-
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
@@ -115,10 +113,10 @@ find %{buildroot} -type f -name '*.so' -exec chmod 0755 {}
\;
chmod 0755 %{buildroot}%{_sbindir}/nginx
%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
-%{__install} -p -D -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
+%{__install} -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d
-%{__install} -p -m 0644 %{SOURCE8} %{buildroot}%{nginx_confdir}
-%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE6}
%{buildroot}%{nginx_confdir}/conf.d
+%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{buildroot}%{nginx_confdir}/conf.d
+%{__install} -p -m 0644 %{SOURCE6} %{buildroot}%{nginx_confdir}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir}
%{__install} -p -d -m 0755 %{buildroot}%{nginx_webroot}
@@ -136,10 +134,14 @@ done
rm -rf %{buildroot}
%pre
-%{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home}
%{nginx_user} 2>/dev/null || :
+if [ $1 == 1 ]; then
+ %{_sbindir}/useradd -c "Nginx user" -s /bin/false -r -d %{nginx_home}
%{nginx_user} 2>/dev/null || :
+fi
%post
-/sbin/chkconfig --add %{name}
+if [ $1 == 1 ]; then
+ /sbin/chkconfig --add %{name}
+fi
%preun
if [ $1 = 0 ]; then
@@ -148,13 +150,13 @@ if [ $1 = 0 ]; then
fi
%postun
-if [ $1 -ge 1 ]; then
- /sbin/service %{name} condrestart > /dev/null 2>&1 || :
+if [ $1 == 2 ]; then
+ /sbin/service %{name} upgrade || :
fi
%files
%defattr(-,root,root,-)
-%doc LICENSE CHANGES README nginx-upstream-fair/README.nginx-upstream-fair
+%doc LICENSE CHANGES README
%{nginx_datadir}/
%{_sbindir}/%{name}
%{_mandir}/man3/%{name}.3pm.gz
@@ -166,8 +168,14 @@ fi
%config(noreplace) %{nginx_confdir}/win-utf
%config(noreplace) %{nginx_confdir}/%{name}.conf.default
%config(noreplace) %{nginx_confdir}/mime.types.default
+%config(noreplace) %{nginx_confdir}/fastcgi.conf
+%config(noreplace) %{nginx_confdir}/fastcgi.conf.default
%config(noreplace) %{nginx_confdir}/fastcgi_params
%config(noreplace) %{nginx_confdir}/fastcgi_params.default
+%config(noreplace) %{nginx_confdir}/scgi_params
+%config(noreplace) %{nginx_confdir}/scgi_params.default
+%config(noreplace) %{nginx_confdir}/uwsgi_params
+%config(noreplace) %{nginx_confdir}/uwsgi_params.default
%config(noreplace) %{nginx_confdir}/koi-win
%config(noreplace) %{nginx_confdir}/koi-utf
%config(noreplace) %{nginx_confdir}/%{name}.conf
@@ -182,6 +190,9 @@ fi
%changelog
+* Sun Oct 31 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.8.53-1
+- Update to new stable 0.8.53 since 0.6.x branch is no longer supported
+
* Sun Jun 20 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 0.6.39-5
- fix bug #591543
diff --git a/sources b/sources
index dded03f..8f1cbe0 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5c22787fe88e37d694e773f1dda52005 nginx-0.6.39.tar.gz
+717eaea1b34e8663849f64b9aa05a9da nginx-0.8.53.tar.gz