Moved from packages repo.
diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..dd0b602 --- /dev/null +++ b/debian/changelog
@@ -0,0 +1,258 @@ +nginx (1.7.2-1) unstable; urgency=low + + * 1.7.2 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 17 Jun 2014 18:18:00 +0400 + +nginx (1.7.1-1) unstable; urgency=low + + * 1.7.1 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 27 May 2014 18:12:00 +0400 + +nginx (1.7.0-1) unstable; urgency=low + + * 1.7.0 + + -- Konstantin Pavlov <thresh@nginx.com> Thu, 24 Apr 2014 19:30:07 +0400 + +nginx (1.5.13-1) unstable; urgency=low + + * 1.5.13 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 08 Apr 2014 17:00:00 +0400 + +nginx (1.5.12-1) unstable; urgency=low + + * 1.5.12 + * warning added when binary upgrade returns non-zero exit code + + -- Sergey Budnevitch <sb@nginx.com> Tue, 18 Mar 2014 16:04:01 +0400 + +nginx (1.5.11-1) unstable; urgency=low + + * 1.5.11 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 04 Mar 2014 15:33:32 +0400 + +nginx (1.5.10-1) unstable; urgency=low + + * 1.5.10 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 04 Feb 2014 16:12:01 +0400 + +nginx (1.5.9-1) unstable; urgency=low + + * 1.5.9 + + -- Sergey Budnevitch <sb@nginx.com> Wed, 22 Jan 2014 17:54:40 +0400 + +nginx (1.5.8-1) unstable; urgency=low + + * 1.5.8 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 17 Dec 2013 18:05:32 +0400 + +nginx (1.5.7-1) unstable; urgency=low + + * 1.5.7 + * init script now honours additional options sourced from /etc/default/nginx + + -- Sergey Budnevitch <sb@nginx.com> Tue, 19 Nov 2013 15:59:56 +0400 + +nginx (1.5.6-1) unstable; urgency=low + + * 1.5.6 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 01 Oct 2013 16:35:33 +0400 + +nginx (1.5.5-1) unstable; urgency=low + + * 1.5.5 + + -- Andrei Belov <defan@nginx.com> Tue, 17 Sep 2013 17:40:00 +0400 + +nginx (1.5.4-1) unstable; urgency=low + + * 1.5.4 + * auth request module added + + -- Sergey Budnevitch <sb@nginx.com> Tue, 27 Aug 2013 15:00:00 +0400 + +nginx (1.5.3-1) unstable; urgency=low + + * 1.5.3 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 30 Jul 2013 13:55:04 +0400 + +nginx (1.5.2-1) unstable; urgency=low + + * 1.5.2 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 02 Jul 2013 17:27:00 +0400 + +nginx (1.5.1-1) unstable; urgency=low + + * 1.5.1 + * dpkg-buildflags options now passed by --with-{cc,ld}-opt + + -- Sergey Budnevitch <sb@nginx.com> Tue, 04 Jun 2013 17:45:54 +0400 + +nginx (1.5.0-1) unstable; urgency=low + + * 1.5.0 + * fixed openssl version detection with dash as /bin/sh + + -- Sergey Budnevitch <sb@nginx.com> Tue, 06 May 2013 14:15:00 +0400 + +nginx (1.3.16-1) unstable; urgency=low + + * 1.3.16 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 16 Apr 2013 16:44:00 +0400 + +nginx (1.3.15-1) unstable; urgency=low + + * 1.3.15 + * gunzip module added + * spdy module added if openssl version >= 1.0.1 + * set permissions on default log files at installation + + -- Sergey Budnevitch <sb@nginx.com> Tue, 26 Mar 2013 19:05:00 +0400 + +nginx (1.2.7-1) unstable; urgency=low + + * 1.2.7 + * excess slash removed from --prefix + + -- Sergey Budnevitch <sb@nginx.com> Tue, 12 Feb 2013 17:45:00 +0400 + +nginx (1.2.6-1) unstable; urgency=low + + * 1.2.6 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 11 Dec 2012 18:40:00 +0400 + +nginx (1.2.5-1) unstable; urgency=low + + * 1.2.5 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 13 Nov 2012 15:52:57 +0400 + +nginx (1.2.4-1) unstable; urgency=low + + * 1.2.4 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 25 Sep 2012 14:54:32 +0400 + +nginx (1.2.3-1) unstable; urgency=low + + * 1.2.3 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 07 Aug 2012 15:51:30 +0400 + +nginx (1.2.2-1) unstable; urgency=low + + * 1.2.2 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 03 Jul 2012 15:31:29 +0400 + +nginx (1.2.1-1) unstable; urgency=low + + * 1.2.1 + * package provides 'httpd' (ticket #158) + * upgrade action added to postinst script + * minor fix in prerm + + -- Sergey Budnevitch <sb@nginx.com> Tue, 05 Jun 2012 14:41:56 +0400 + +nginx (1.2.0-1) unstable; urgency=low + + * 1.2.0 + + -- Sergey Budnevitch <sb@nginx.com> Mon, 23 Apr 2012 17:04:12 +0400 + +nginx (1.0.15-1) unstable; urgency=low + + * 1.0.15 + + -- Sergey Budnevitch <sb@nginx.com> Thu, 12 Apr 2012 16:40:00 +0400 + +nginx (1.0.14-2) unstable; urgency=low + * postinst script added to fix error on installation when another + process listens on 80 port + + -- Sergey Budnevitch <sb@nginx.com> Thu, 22 Mar 2012 12:40:34 +0400 + +nginx (1.0.14-1) unstable; urgency=low + + * 1.0.14 + + -- Sergey Budnevitch <sb@nginx.com> Thu, 15 Mar 2012 16:47:09 +0400 + +nginx (1.0.13-1) unstable; urgency=low + + * 1.0.13 + + -- Sergey Budnevitch <sb@nginx.com> Mon, 05 Mar 2012 20:19:10 +0400 + +nginx (1.0.12-1) unstable; urgency=low + + * 1.0.12 + * banner added to install script + + -- Sergey Budnevitch <sb@nginx.com> Mon, 06 Feb 2012 18:24:15 +0400 + +nginx (1.0.11-1) unstable; urgency=low + + * 1.0.11 + * init script enhancements (thanks to Gena Makhomed) + + -- Sergey Budnevitch <sb@nginx.com> Thu, 15 Dec 2011 19:05:46 +0400 + +nginx (1.0.10-1) unstable; urgency=low + + * 1.0.10 + + -- Sergey Budnevitch <sb@nginx.com> Tue, 15 Nov 2011 12:55:36 +0400 + +nginx (1.0.9-1) unstable; urgency=low + + * 1.0.9 + * nginx-debug package added + + -- Sergey Budnevitch <sb@nginx.com> Tue, 01 Nov 2011 18:54:02 +0400 + +nginx (1.0.8-2) unstable; urgency=low + + * typo in configure fixed + * upgrade and configtest arguments to init-script added (based on fedora one) + * logrotate creates new logfiles with nginx owner + + -- Sergey Budnevitch <sb@nginx.com> Tue, 11 Oct 2011 19:49:11 +0400 + +nginx (1.0.8-1) unstable; urgency=low + + * 1.0.8 + * built with mp4 module + + -- Sergey Budnevitch <sb@nginx.com> Sat, 01 Oct 2011 17:22:17 +0400 + +nginx (1.0.7-1) unstable; urgency=low + + * 1.0.7 + + -- Sergey Budnevitch <sb@nginx.com> Fri, 30 Sep 2011 18:34:17 +0400 + +nginx (1.0.6-1) unstable; urgency=low + + * 1.0.6 + * replace "conf.d/*" config include with "conf.d/*.conf" in default nginx.conf + + -- Sergey Budnevitch <sb@nginx.com> Tue, 30 Aug 2011 19:27:16 +0400 + +nginx (1.0.5-1) unstable; urgency=low + + * Initial release + + -- Sergey Budnevitch <sb@nginx.com> Thu, 11 Aug 2011 12:57:47 +0400
diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat
@@ -0,0 +1 @@ +7
diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3997b8d --- /dev/null +++ b/debian/control
@@ -0,0 +1,23 @@ +Source: nginx +Section: httpd +Priority: optional +Maintainer: Sergey Budnevitch <sb@nginx.com> +Build-Depends: debhelper (>= 7.0.50~), libssl-dev (>= 0.9.7), libpcre3-dev, zlib1g-dev +Standards-Version: 3.9.1 +Homepage: http://nginx.org + +Package: nginx +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, lsb-base, adduser +Provides: httpd +Description: high performance web server + nginx [engine x] is an HTTP and reverse proxy server, as well as + a mail proxy server. + +Package: nginx-debug +Architecture: any +Section: debug +Priority: extra +Depends: ${misc:Depends}, ${shlibs:Depends}, nginx (= ${binary:Version}) +Description: debug version of nginx + Not stripped version of nginx built with the debugging log support.
diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..7fa0cbf --- /dev/null +++ b/debian/copyright
@@ -0,0 +1,43 @@ +This work was packaged by: + + Sergey Budnevitch <sb@nginx.com> on Thu, 11 Aug 2011 12:57:47 +0400 + +It was downloaded from: + + <http://nginx.org/download/> + +Upstream Author: + + Igor Sysoev <igor@sysoev.ru> + +Copyright: + + Copyright (C) 2002-2011 Igor Sysoev + +License: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +The Debian packaging is: + + Copyright (C) 2011 nginx inc. + provided under the same license as nginx itself.
diff --git a/debian/init.d b/debian/init.d new file mode 100644 index 0000000..2176862 --- /dev/null +++ b/debian/init.d
@@ -0,0 +1,154 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: nginx +# Required-Start: $network $remote_fs $local_fs +# Required-Stop: $network $remote_fs $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Stop/start nginx +### END INIT INFO + +# Author: Sergey Budnevitch <sb@nginx.com> + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC=nginx +NAME=nginx +CONFFILE=/etc/nginx/nginx.conf +DAEMON=/usr/sbin/nginx +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME +SLEEPSEC=1 +UPGRADEWAITLOOPS=5 + +[ -x $DAEMON ] || exit 0 + +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +DAEMON_ARGS="-c $CONFFILE $DAEMON_ARGS" + +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +do_start() +{ + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + $DAEMON_ARGS + RETVAL="$?" + return "$RETVAL" +} + +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + rm -f $PIDFILE + return "$RETVAL" +} + +do_reload() { + # + start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME + RETVAL="$?" + return "$RETVAL" +} + +do_configtest() { + if [ "$#" -ne 0 ]; then + case "$1" in + -q) + FLAG=$1 + ;; + *) + ;; + esac + shift + fi + $DAEMON -t $FLAG -c $CONFFILE + RETVAL="$?" + return $RETVAL +} + +do_upgrade() { + OLDBINPIDFILE=$PIDFILE.oldbin + + do_configtest -q || return 6 + start-stop-daemon --stop --signal USR2 --quiet --pidfile $PIDFILE --name $NAME + RETVAL="$?" + + for i in `/usr/bin/seq $UPGRADEWAITLOOPS`; do + sleep $SLEEPSEC + if [ -f $OLDBINPIDFILE -a -f $PIDFILE ]; then + start-stop-daemon --stop --signal QUIT --quiet --pidfile $OLDBINPIDFILE --name $NAME + RETVAL="$?" + return + fi + done + + echo $"Upgrade failed!" + RETVAL=1 + return $RETVAL +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + configtest) + do_configtest + ;; + upgrade) + do_upgrade + ;; + reload|force-reload) + log_daemon_msg "Reloading $DESC" "$NAME" + do_reload + log_end_msg $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_configtest -q || exit $RETVAL + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload|upgrade|configtest}" >&2 + exit 3 + ;; +esac + +exit $RETVAL
diff --git a/debian/logrotate b/debian/logrotate new file mode 100644 index 0000000..a94b400 --- /dev/null +++ b/debian/logrotate
@@ -0,0 +1,13 @@ +/var/log/nginx/*.log { + daily + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 nginx adm + sharedscripts + postrotate + [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` + endscript +}
diff --git a/debian/nginx-debug.install b/debian/nginx-debug.install new file mode 100644 index 0000000..333858c --- /dev/null +++ b/debian/nginx-debug.install
@@ -0,0 +1 @@ +objs/nginx.debug usr/sbin
diff --git a/debian/nginx.conf b/debian/nginx.conf new file mode 100644 index 0000000..e4bad8d --- /dev/null +++ b/debian/nginx.conf
@@ -0,0 +1,32 @@ + +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +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" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +}
diff --git a/debian/nginx.default b/debian/nginx.default new file mode 100644 index 0000000..cadb439 --- /dev/null +++ b/debian/nginx.default
@@ -0,0 +1,5 @@ +# Defaults for nginx initscript +# sourced by /etc/init.d/nginx + +# Additional options that are passed to nginx +DAEMON_ARGS=""
diff --git a/debian/nginx.dirs b/debian/nginx.dirs new file mode 100644 index 0000000..20fbb42 --- /dev/null +++ b/debian/nginx.dirs
@@ -0,0 +1,6 @@ +/usr/sbin +/etc/nginx/conf.d +/usr/share/nginx +/usr/share/nginx/html +/var/cache/nginx +/var/log/nginx
diff --git a/debian/nginx.docs b/debian/nginx.docs new file mode 100644 index 0000000..6268349 --- /dev/null +++ b/debian/nginx.docs
@@ -0,0 +1,2 @@ +README +CHANGES.ru
diff --git a/debian/nginx.postinst b/debian/nginx.postinst new file mode 100644 index 0000000..e0b6e6b --- /dev/null +++ b/debian/nginx.postinst
@@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +if [ "$1" != "configure" ]; then + exit 0 +fi + +# Touch and set permisions on default log files on installation +if [ -z "$2" ]; then + if [ -d /var/log/nginx ]; then + if [ ! -e /var/log/nginx/access.log ]; then + touch /var/log/nginx/access.log + chmod 640 /var/log/nginx/access.log + chown nginx:adm /var/log/nginx/access.log + fi + + if [ ! -e /var/log/nginx/error.log ]; then + touch /var/log/nginx/error.log + chmod 640 /var/log/nginx/error.log + chown nginx:adm /var/log/nginx/error.log + fi + fi +fi + +if [ -x "/etc/init.d/nginx" ]; then + if [ -f "/var/run/nginx.pid" ] && kill -0 `cat /var/run/nginx.pid` >/dev/null; then + /etc/init.d/nginx upgrade || echo \ + "Binary upgrade failed, please check nginx's error.log" + else + update-rc.d nginx defaults >/dev/null + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d nginx start || true + else + /etc/init.d/nginx start || true + fi + fi +fi
diff --git a/debian/nginx.postrm b/debian/nginx.postrm new file mode 100644 index 0000000..2755de9 --- /dev/null +++ b/debian/nginx.postrm
@@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +case "$1" in + purge) + rm -rf /var/cache/nginx /var/log/nginx /etc/nginx + ;; + remove) + rm -rf /var/cache/nginx /var/log/nginx + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 +esac + +#DEBHELPER# + +exit 0
diff --git a/debian/nginx.preinst b/debian/nginx.preinst new file mode 100644 index 0000000..8d2fbe1 --- /dev/null +++ b/debian/nginx.preinst
@@ -0,0 +1,58 @@ +#! /bin/sh +# preinst script for nginx + +set -e + +addnginxuser() { + # creating nginx group if he isn't already there + if ! getent group nginx >/dev/null; then + addgroup --system nginx >/dev/null + fi + + # creating nginx user if he isn't already there + if ! getent passwd nginx >/dev/null; then + adduser \ + --system \ + --disabled-login \ + --ingroup nginx \ + --no-create-home \ + --home /nonexistent \ + --gecos "nginx user" \ + --shell /bin/false \ + nginx >/dev/null + fi +} + +case "$1" in + install) + addnginxuser + cat <<BANNER +---------------------------------------------------------------------- + +Thanks for using nginx! + +Please find the official documentation for nginx here: +* http://nginx.org/en/docs/ + +Commercial subscriptions for nginx are available on: +* http://nginx.com/products/ + +---------------------------------------------------------------------- +BANNER + ;; + upgrade) + addnginxuser + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0
diff --git a/debian/nginx.prerm b/debian/nginx.prerm new file mode 100644 index 0000000..7c26a4f --- /dev/null +++ b/debian/nginx.prerm
@@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "$1" in + remove|deconfigure|remove-in-favour|deconfigure-in-favour) + if [ -x "/etc/init.d/nginx" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d nginx stop || true + else + /etc/init.d/nginx stop || true + fi + fi + ;; + upgrade|failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + ;; +esac + +exit 0
diff --git a/debian/nginx.vh.default.conf b/debian/nginx.vh.default.conf new file mode 100644 index 0000000..34aeb9a --- /dev/null +++ b/debian/nginx.vh.default.conf
@@ -0,0 +1,45 @@ +server { + listen 80; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/log/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} +
diff --git a/debian/nginx.vh.example_ssl.conf b/debian/nginx.vh.example_ssl.conf new file mode 100644 index 0000000..67ad4a1 --- /dev/null +++ b/debian/nginx.vh.example_ssl.conf
@@ -0,0 +1,20 @@ +# HTTPS server +# +#server { +# listen 443 ssl; +# server_name localhost; + +# ssl_certificate /etc/nginx/cert.pem; +# ssl_certificate_key /etc/nginx/cert.key; + +# ssl_session_cache shared:SSL:1m; +# ssl_session_timeout 5m; + +# ssl_ciphers HIGH:!aNULL:!MD5; +# ssl_prefer_server_ciphers on; + +# location / { +# root /usr/share/nginx/html; +# index index.html index.htm; +# } +#}
diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a0a9806 --- /dev/null +++ b/debian/rules
@@ -0,0 +1,110 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 +CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS) +LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS) +WITH_SPDY := $(shell printf "Source: nginx\nBuild-Depends: libssl-dev (>= 1.0.1)\n" | \ + dpkg-checkbuilddeps - >/dev/null 2>&1 && \ + echo "--with-http_spdy_module") + +%: + dh $@ + +override_dh_auto_configure: configure_debug + +override_dh_strip: + dh_strip -Xdebug + +override_dh_auto_build: + dh_auto_build + mv objs/nginx objs/nginx.debug + CFLAGS="" ./configure \ + --prefix=/etc/nginx \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/run/nginx.lock \ + --http-client-body-temp-path=/var/cache/nginx/client_temp \ + --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ + --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ + --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ + --user=nginx \ + --group=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_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_stub_status_module \ + --with-http_auth_request_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-file-aio \ + $(WITH_SPDY) \ + --with-cc-opt="$(CFLAGS)" \ + --with-ld-opt="$(LDFLAGS)" \ + --with-ipv6 + dh_auto_build + +configure_debug: + CFLAGS="" ./configure \ + --prefix=/etc/nginx \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/run/nginx.lock \ + --http-client-body-temp-path=/var/cache/nginx/client_temp \ + --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ + --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ + --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ + --user=nginx \ + --group=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_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_stub_status_module \ + --with-http_auth_request_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-file-aio \ + $(WITH_SPDY) \ + --with-cc-opt="$(CFLAGS)" \ + --with-ld-opt="$(LDFLAGS)" \ + --with-ipv6 \ + --with-debug + +override_dh_auto_install: + dh_auto_install + /usr/bin/install -m 644 debian/nginx.conf debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/win-utf debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/koi-utf debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/koi-win debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/mime.types debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/scgi_params debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/fastcgi_params debian/nginx/etc/nginx/ + /usr/bin/install -m 644 conf/uwsgi_params debian/nginx/etc/nginx/ + /usr/bin/install -m 644 html/index.html debian/nginx/usr/share/nginx/html/ + /usr/bin/install -m 644 html/50x.html debian/nginx/usr/share/nginx/html/ + /usr/bin/install -m 644 debian/nginx.vh.default.conf debian/nginx/etc/nginx/conf.d/default.conf + /usr/bin/install -m 644 debian/nginx.vh.example_ssl.conf debian/nginx/etc/nginx/conf.d/example_ssl.conf + /usr/bin/install -m 755 objs/nginx debian/nginx/usr/sbin/
diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format
@@ -0,0 +1 @@ +3.0 (quilt)
diff --git a/rpm/SOURCES/RPM-GPG-KEY-nginx b/rpm/SOURCES/RPM-GPG-KEY-nginx new file mode 100644 index 0000000..03b323e --- /dev/null +++ b/rpm/SOURCES/RPM-GPG-KEY-nginx
@@ -0,0 +1,26 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.14 (GNU/Linux) + +mQENBE5OMmIBCAD+FPYKGriGGf7NqwKfWC83cBV01gabgVWQmZbMcFzeW+hMsgxH +W6iimD0RsfZ9oEbfJCPG0CRSZ7ppq5pKamYs2+EJ8Q2ysOFHHwpGrA2C8zyNAs4I +QxnZZIbETgcSwFtDun0XiqPwPZgyuXVm9PAbLZRbfBzm8wR/3SWygqZBBLdQk5TE +fDR+Eny/M1RVR4xClECONF9UBB2ejFdI1LD45APbP2hsN/piFByU1t7yK2gpFyRt +97WzGHn9MV5/TL7AmRPM4pcr3JacmtCnxXeCZ8nLqedoSuHFuhwyDnlAbu8I16O5 +XRrfzhrHRJFM1JnIiGmzZi6zBvH0ItfyX6ttABEBAAG0KW5naW54IHNpZ25pbmcg +a2V5IDxzaWduaW5nLWtleUBuZ2lueC5jb20+iQE+BBMBAgAoBQJOTjJiAhsDBQkJ +ZgGABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRCr9b2Ce9m/YpvjB/98uV4t +94d0oEh5XlqEZzVMrcTgPQ3BZt05N5xVuYaglv7OQtdlErMXmRWaFZEqDaMHdniC +sF63jWMd29vC4xpzIfmsLK3ce9oYo4t9o4WWqBUdf0Ff1LMz1dfLG2HDtKPfYg3C +8NESud09zuP5NohaE8Qzj/4p6rWDiRpuZ++4fnL3Dt3N6jXILwr/TM/Ma7jvaXGP +DO3kzm4dNKp5b5bn2nT2QWLPnEKxvOg5Zoej8l9+KFsUnXoWoYCkMQ2QTpZQFNwF +xwJGoAz8K3PwVPUrIL6b1lsiNovDgcgP0eDgzvwLynWKBPkRRjtgmWLoeaS9FAZV +ccXJMmANXJFuCf26iQEcBBABAgAGBQJOTkelAAoJEKZP1bF62zmo79oH/1XDb29S +YtWp+MTJTPFEwlWRiyRuDXy3wBd/BpwBRIWfWzMs1gnCjNjk0EVBVGa2grvy9Jtx +JKMd6l/PWXVucSt+U/+GO8rBkw14SdhqxaS2l14v6gyMeUrSbY3XfToGfwHC4sa/ +Thn8X4jFaQ2XN5dAIzJGU1s5JA0tjEzUwCnmrKmyMlXZaoQVrmORGjCuH0I0aAFk +RS0UtnB9HPpxhGVbs24xXZQnZDNbUQeulFxS4uP3OLDBAeCHl+v4t/uotIad8v6J +SO93vc1evIje6lguE81HHmJn9noxPItvOvSMb2yPsE8mH4cJHRTFNSEhPW6ghmlf +Wa9ZwiVX5igxcvaIRgQQEQIABgUCTk5b0gAKCRDs8OkLLBcgg1G+AKCnacLb/+W6 +cflirUIExgZdUJqoogCeNPVwXiHEIVqithAM1pdY/gcaQZk= +=zY5g +-----END PGP PUBLIC KEY BLOCK-----
diff --git a/rpm/SOURCES/logrotate b/rpm/SOURCES/logrotate new file mode 100644 index 0000000..a94b400 --- /dev/null +++ b/rpm/SOURCES/logrotate
@@ -0,0 +1,13 @@ +/var/log/nginx/*.log { + daily + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 nginx adm + sharedscripts + postrotate + [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` + endscript +}
diff --git a/rpm/SOURCES/nginx.conf b/rpm/SOURCES/nginx.conf new file mode 100644 index 0000000..e4bad8d --- /dev/null +++ b/rpm/SOURCES/nginx.conf
@@ -0,0 +1,32 @@ + +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +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" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +}
diff --git a/rpm/SOURCES/nginx.init b/rpm/SOURCES/nginx.init new file mode 100755 index 0000000..d592617 --- /dev/null +++ b/rpm/SOURCES/nginx.init
@@ -0,0 +1,152 @@ +#!/bin/sh +# +# nginx Startup script for nginx +# +# chkconfig: - 85 15 +# processname: nginx +# config: /etc/nginx/nginx.conf +# config: /etc/sysconfig/nginx +# pidfile: /var/run/nginx.pid +# description: nginx is an HTTP and reverse proxy server +# +### BEGIN INIT INFO +# Provides: nginx +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop nginx +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ -L $0 ]; then + initscript=`/bin/readlink -f $0` +else + initscript=$0 +fi + +sysconfig=`/bin/basename $initscript` + +if [ -f /etc/sysconfig/$sysconfig ]; then + . /etc/sysconfig/$sysconfig +fi + +nginx=${NGINX-/usr/sbin/nginx} +prog=`/bin/basename $nginx` +conffile=${CONFFILE-/etc/nginx/nginx.conf} +lockfile=${LOCKFILE-/var/lock/subsys/nginx} +pidfile=${PIDFILE-/var/run/nginx.pid} +SLEEPMSEC=${SLEEPMSEC-200000} +UPGRADEWAITLOOPS=${UPGRADEWAITLOOPS-5} +RETVAL=0 + +start() { + echo -n $"Starting $prog: " + + daemon --pidfile=${pidfile} ${nginx} -c ${conffile} + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch ${lockfile} + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p ${pidfile} ${prog} + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} +} + +reload() { + echo -n $"Reloading $prog: " + killproc -p ${pidfile} ${prog} -HUP + RETVAL=$? + echo +} + +upgrade() { + oldbinpidfile=${pidfile}.oldbin + + configtest -q || return + echo -n $"Starting new master $prog: " + killproc -p ${pidfile} ${prog} -USR2 + echo + + for i in `/usr/bin/seq $UPGRADEWAITLOOPS`; do + /bin/usleep $SLEEPMSEC + if [ -f ${oldbinpidfile} -a -f ${pidfile} ]; then + echo -n $"Graceful shutdown of old $prog: " + killproc -p ${oldbinpidfile} ${prog} -QUIT + RETVAL=$? + echo + return + fi + done + + echo $"Upgrade failed!" + RETVAL=1 +} + +configtest() { + if [ "$#" -ne 0 ] ; then + case "$1" in + -q) + FLAG=$1 + ;; + *) + ;; + esac + shift + fi + ${nginx} -t -c ${conffile} $FLAG + RETVAL=$? + return $RETVAL +} + +rh_status() { + status -p ${pidfile} ${nginx} +} + +# See how we were called. +case "$1" in + start) + rh_status >/dev/null 2>&1 && exit 0 + start + ;; + stop) + stop + ;; + status) + rh_status + RETVAL=$? + ;; + restart) + configtest -q || exit $RETVAL + stop + start + ;; + upgrade) + rh_status >/dev/null 2>&1 || exit 0 + upgrade + ;; + condrestart|try-restart) + if rh_status >/dev/null 2>&1; then + stop + start + fi + ;; + force-reload|reload) + reload + ;; + configtest) + configtest + ;; + *) + echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest}" + RETVAL=2 +esac + +exit $RETVAL
diff --git a/rpm/SOURCES/nginx.repo b/rpm/SOURCES/nginx.repo new file mode 100644 index 0000000..10b7c1e --- /dev/null +++ b/rpm/SOURCES/nginx.repo
@@ -0,0 +1,7 @@ +# nginx.repo + +[nginx] +name=nginx repo +baseurl=http://nginx.org/packages/OS/RELEASEVER/$basearch/ +gpgcheck=0 +enabled=1
diff --git a/rpm/SOURCES/nginx.service b/rpm/SOURCES/nginx.service new file mode 100644 index 0000000..ed8fb78 --- /dev/null +++ b/rpm/SOURCES/nginx.service
@@ -0,0 +1,16 @@ +[Unit] +Description=nginx - high performance web server +Documentation=http://nginx.org/en/docs/ +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +PIDFile=/run/nginx.pid +ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf +ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +PrivateTmp=true + +[Install] +WantedBy=multi-user.target
diff --git a/rpm/SOURCES/nginx.suse.init b/rpm/SOURCES/nginx.suse.init new file mode 100755 index 0000000..e6abde3 --- /dev/null +++ b/rpm/SOURCES/nginx.suse.init
@@ -0,0 +1,138 @@ +#!/bin/sh +# +# Template SUSE system startup script for example service/daemon FOO +# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +### BEGIN INIT INFO +# Provides: nginx +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop nginx +### END INIT INFO + +# Check for existence of needed config file and read it +NGINX_CONFIG=/etc/sysconfig/nginx +test -r $NGINX_CONFIG || { echo "$NGINX_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +# Read config +. $NGINX_CONFIG + +test -x $nginx || { echo "$nginx not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +nginx=${NGINX-/usr/sbin/nginx} +conffile=${CONFFILE-/etc/nginx/nginx.conf} +pidfile=${PIDFILE-/var/run/nginx.pid} +SLEEPMSEC=100000 + +. /etc/rc.status + +rc_reset + +upgrade() { + oldbinpidfile=${pidfile}.oldbin + + configtest -q || return 6 + echo -n $"Starting new master: " + /sbin/killproc -p ${pidfile} -USR2 $nginx + /bin/usleep $SLEEPMSEC + if [ -f ${oldbinpidfile} -a -f ${pidfile} ]; then + echo -n $"Graceful shutdown of old nginx: " + killproc -p ${oldbinpidfile} -QUIT $nginx + else + echo $"Upgrade failed!" + return 1 + fi +} + +configtest() { + if [ "$#" -ne 0 ] ; then + case "$1" in + -q) + FLAG=$1 + ;; + *) + ;; + esac + shift + fi + ${nginx} -t -c ${conffile} $FLAG +} + + +case "$1" in + start) + echo -n "Starting nginx " + $0 status + if test $? -ne 0; then + /sbin/startproc $nginx -c $conffile + else + rc_reset + fi + rc_status -v + ;; + stop) + echo -n "Shutting down nginx " + + /sbin/killproc -p $pidfile $nginx + rc_status -v + ;; + try-restart|condrestart) + $0 status + if test $? -eq 0; then + $0 restart + else + rc_reset + fi + rc_status + ;; + restart) + configtest -q || exit 6 + $0 stop + $0 start + rc_status + ;; + reload|force-reload) + echo -n "Reload service nginx " + /sbin/killproc -p $pidfile -HUP $nginx + rc_status -v + ;; + status) + echo -n "Checking for service nginx " + + /sbin/checkproc $nginx + rc_status -v + ;; + upgrade) + upgrade + rc_status -v + ;; + configtest) + configtest + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|upgrade|configtest}" + exit 1 + ;; +esac +rc_exit
diff --git a/rpm/SOURCES/nginx.sysconf b/rpm/SOURCES/nginx.sysconf new file mode 100644 index 0000000..6c31a48 --- /dev/null +++ b/rpm/SOURCES/nginx.sysconf
@@ -0,0 +1,4 @@ +# Configuration file for the nginx service. + +NGINX=/usr/sbin/nginx +CONFFILE=/etc/nginx/nginx.conf
diff --git a/rpm/SOURCES/nginx.upgrade.sh b/rpm/SOURCES/nginx.upgrade.sh new file mode 100644 index 0000000..2bd869b --- /dev/null +++ b/rpm/SOURCES/nginx.upgrade.sh
@@ -0,0 +1,32 @@ +#!/bin/sh +# +# Legacy action script for "service nginx upgrade" + +# Source function library. +. /etc/rc.d/init.d/functions + +prog=nginx +nginx=/usr/sbin/nginx +conffile=/etc/nginx/nginx.conf +pidfile=`/usr/bin/systemctl show -p PIDFile nginx.service | sed 's/^PIDFile=//' | tr ' ' '\n'` +SLEEPMSEC=100000 +RETVAL=0 + +oldbinpidfile=${pidfile}.oldbin +${nginx} -t -c ${conffile} -q || return 6 +echo -n $"Starting new master $prog: " +killproc -p ${pidfile} ${prog} -USR2 +RETVAL=$? +echo +/bin/usleep $SLEEPMSEC +if [ -f ${oldbinpidfile} -a -f ${pidfile} ]; then + echo -n $"Graceful shutdown of old $prog: " + killproc -p ${oldbinpidfile} ${prog} -QUIT + RETVAL=$? + echo +else + echo $"Upgrade failed!" + return 1 +fi + +exit $RETVAL
diff --git a/rpm/SOURCES/nginx.vh.default.conf b/rpm/SOURCES/nginx.vh.default.conf new file mode 100644 index 0000000..34aeb9a --- /dev/null +++ b/rpm/SOURCES/nginx.vh.default.conf
@@ -0,0 +1,45 @@ +server { + listen 80; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/log/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} +
diff --git a/rpm/SOURCES/nginx.vh.example_ssl.conf b/rpm/SOURCES/nginx.vh.example_ssl.conf new file mode 100644 index 0000000..67ad4a1 --- /dev/null +++ b/rpm/SOURCES/nginx.vh.example_ssl.conf
@@ -0,0 +1,20 @@ +# HTTPS server +# +#server { +# listen 443 ssl; +# server_name localhost; + +# ssl_certificate /etc/nginx/cert.pem; +# ssl_certificate_key /etc/nginx/cert.key; + +# ssl_session_cache shared:SSL:1m; +# ssl_session_timeout 5m; + +# ssl_ciphers HIGH:!aNULL:!MD5; +# ssl_prefer_server_ciphers on; + +# location / { +# root /usr/share/nginx/html; +# index index.html index.htm; +# } +#}
diff --git a/rpm/SPECS/nginx-release-centos.spec b/rpm/SPECS/nginx-release-centos.spec new file mode 100644 index 0000000..295063f --- /dev/null +++ b/rpm/SPECS/nginx-release-centos.spec
@@ -0,0 +1,44 @@ +%define os_variant centos + +Name: nginx-release-%{os_variant} +Version: %{rhel} +Release: 0%{?dist}.ngx +Summary: nginx repo configuration and pgp public keys + +Group: System Environment/Base +License: BSD +URL: http://nginx.org +Source0: nginx.repo +Source1: RPM-GPG-KEY-nginx +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +Provides: nginx-release + +BuildArch: noarch + +%description +yum config files for nginx repository, and nginx public signing key. +After the package installation you will be able to import the key +to rpm with the "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-nginx" +command, and turn on option gpgcheck in /etc/yum.repos.d/nginx.repo + +%install +%{__rm} -rf $RPM_BUILD_ROOT +%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d +%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg +%{__install} -m 644 -p %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/ +%{__sed} -i "s/OS/%{os_variant}/" $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/nginx.repo +%{__sed} -i "s/RELEASEVER/%{rhel}/" $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/nginx.repo +%{__install} -m 644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(0644,root,root) +%config(noreplace) %{_sysconfdir}/yum.repos.d/nginx.repo +%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-nginx + +%changelog +* Fri Oct 14 2011 Sergey Budnevitch <sb@nginx.com> +- Initial release
diff --git a/rpm/SPECS/nginx-release-rhel.spec b/rpm/SPECS/nginx-release-rhel.spec new file mode 100644 index 0000000..b884a4b --- /dev/null +++ b/rpm/SPECS/nginx-release-rhel.spec
@@ -0,0 +1,44 @@ +%define os_variant rhel + +Name: nginx-release-%{os_variant} +Version: %{rhel} +Release: 0%{?dist}.ngx +Summary: nginx repo configuration and pgp public keys + +Group: System Environment/Base +License: BSD +URL: http://nginx.org +Source0: nginx.repo +Source1: RPM-GPG-KEY-nginx +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +Provides: nginx-release + +BuildArch: noarch + +%description +yum config files for nginx repository, and nginx public signing key. +After the package installation you will be able to import the key +to rpm with the "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-nginx" +command, and turn on option gpgcheck in /etc/yum.repos.d/nginx.repo + +%install +%{__rm} -rf $RPM_BUILD_ROOT +%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d +%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg +%{__install} -m 644 -p %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/ +%{__sed} -i "s/OS/%{os_variant}/" $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/nginx.repo +%{__sed} -i "s/RELEASEVER/%{rhel}/" $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/nginx.repo +%{__install} -m 644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(0644,root,root) +%config(noreplace) %{_sysconfdir}/yum.repos.d/nginx.repo +%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-nginx + +%changelog +* Fri Oct 14 2011 Sergey Budnevitch <sb@nginx.com> +- Initial release
diff --git a/rpm/SPECS/nginx.spec b/rpm/SPECS/nginx.spec new file mode 100644 index 0000000..e3c0f84 --- /dev/null +++ b/rpm/SPECS/nginx.spec
@@ -0,0 +1,466 @@ +# +%define nginx_home %{_localstatedir}/cache/nginx +%define nginx_user nginx +%define nginx_group nginx + +# distribution specific definitions +%define use_systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7) + +%if 0%{?rhel} == 5 +Group: System Environment/Daemons +Requires(pre): shadow-utils +Requires: initscripts >= 8.36 +Requires(post): chkconfig +Requires: openssl +BuildRequires: openssl-devel +%endif + +%if 0%{?rhel} == 6 +Group: System Environment/Daemons +Requires(pre): shadow-utils +Requires: initscripts >= 8.36 +Requires(post): chkconfig +Requires: openssl >= 1.0.1 +BuildRequires: openssl-devel >= 1.0.1 +%define with_spdy 1 +%endif + +%if 0%{?rhel} == 7 +Group: System Environment/Daemons +Requires(pre): shadow-utils +Requires: systemd +Requires: openssl >= 1.0.1 +BuildRequires: systemd +BuildRequires: openssl-devel >= 1.0.1 +%define with_spdy 1 +%endif + +%if 0%{?suse_version} +Group: Productivity/Networking/Web/Servers +BuildRequires: libopenssl-devel +Requires(pre): pwdutils +%endif + +# end of distribution specific definitions + +Summary: High performance web server +Name: nginx +Version: 1.7.2 +Release: 1%{?dist}.ngx +Vendor: nginx inc. +URL: http://nginx.org/ + +Source0: http://nginx.org/download/%{name}-%{version}.tar.gz +Source1: logrotate +Source2: nginx.init +Source3: nginx.sysconf +Source4: nginx.conf +Source5: nginx.vh.default.conf +Source6: nginx.vh.example_ssl.conf +Source7: nginx.suse.init +Source8: nginx.service +Source9: nginx.upgrade.sh + +License: 2-clause BSD-like license + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: zlib-devel +BuildRequires: pcre-devel + +Provides: webserver + +%description +nginx [engine x] is an HTTP and reverse proxy server, as well as +a mail proxy server. + +%package debug +Summary: debug version of nginx +Group: System Environment/Daemons +Requires: nginx +%description debug +Not stripped version of nginx built with the debugging log support. + +%prep +%setup -q + +%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_addition_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_stub_status_module \ + --with-http_auth_request_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-file-aio \ + --with-ipv6 \ + --with-debug \ + %{?with_spdy:--with-http_spdy_module} \ + --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_addition_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_stub_status_module \ + --with-http_auth_request_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-file-aio \ + --with-ipv6 \ + %{?with_spdy:--with-http_spdy_module} \ + --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 + +%if %{use_systemd} +# install systemd-specific files +%{__mkdir} -p $RPM_BUILD_ROOT%{_unitdir} +%{__install} -m644 %SOURCE8 \ + $RPM_BUILD_ROOT%{_unitdir}/nginx.service +%{__mkdir} -p $RPM_BUILD_ROOT%{_libexecdir}/initscripts/legacy-actions/nginx +%{__install} -m755 %SOURCE9 \ + $RPM_BUILD_ROOT%{_libexecdir}/initscripts/legacy-actions/nginx/upgrade +%else +# 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 +%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}/logrotate.d/nginx +%config(noreplace) %{_sysconfdir}/sysconfig/nginx +%if %{use_systemd} +%{_unitdir}/nginx.service +%dir %{_libexecdir}/initscripts/legacy-actions/nginx +%{_libexecdir}/initscripts/legacy-actions/nginx/* +%else +%{_initrddir}/nginx +%endif + +%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" user +getent 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 service +if [ $1 -eq 1 ]; then +%if %{use_systemd} + /usr/bin/systemctl preset nginx.service >/dev/null 2>&1 ||: +%else + /sbin/chkconfig --add nginx +%endif + # print site info + cat <<BANNER +---------------------------------------------------------------------- + +Thanks for using nginx! + +Please find the official documentation for nginx here: +* http://nginx.org/en/docs/ + +Commercial subscriptions for nginx are available on: +* http://nginx.com/products/ + +---------------------------------------------------------------------- +BANNER + + # Touch and set permisions on default log files on installation + + if [ -d %{_localstatedir}/log/nginx ]; then + if [ ! -e %{_localstatedir}/log/nginx/access.log ]; then + touch %{_localstatedir}/log/nginx/access.log + %{__chmod} 640 %{_localstatedir}/log/nginx/access.log + %{__chown} nginx:adm %{_localstatedir}/log/nginx/access.log + fi + + if [ ! -e %{_localstatedir}/log/nginx/error.log ]; then + touch %{_localstatedir}/log/nginx/error.log + %{__chmod} 640 %{_localstatedir}/log/nginx/error.log + %{__chown} nginx:adm %{_localstatedir}/log/nginx/error.log + fi + fi +fi + +%preun +if [ $1 -eq 0 ]; then +%if %use_systemd + /usr/bin/systemctl --no-reload disable nginx.service >/dev/null 2>&1 ||: + /usr/bin/systemctl stop nginx.service >/dev/null 2>&1 ||: +%else + /sbin/service nginx stop > /dev/null 2>&1 + /sbin/chkconfig --del nginx +%endif +fi + +%postun +%if %use_systemd +/usr/bin/systemctl daemon-reload >/dev/null 2>&1 ||: +%endif +if [ $1 -ge 1 ]; then + /sbin/service nginx status >/dev/null 2>&1 || exit 0 + /sbin/service nginx upgrade >/dev/null 2>&1 || echo \ + "Binary upgrade failed, please check nginx's error.log" +fi + +%changelog +* Tue Jun 17 2014 Sergey Budnevitch <sb@nginx.com> +- 1.7.2 + +* Tue May 27 2014 Sergey Budnevitch <sb@nginx.com> +- 1.7.1 +- incorrect sysconfig filename finding in the initscript fixed + +* Thu Apr 24 2014 Konstantin Pavlov <thresh@nginx.com> +- 1.7.0 + +* Tue Apr 8 2014 Sergey Budnevitch <sb@nginx.com> +- 1.5.13 +- built spdy module on rhel/centos 6 + +* Tue Mar 18 2014 Sergey Budnevitch <sb@nginx.com> +- 1.5.12 +- spec cleanup +- openssl version dependence added +- upgrade() function in the init script improved +- warning added when binary upgrade returns non-zero exit code + +* Tue Mar 4 2014 Sergey Budnevitch <sb@nginx.com> +- 1.5.11 + +* Tue Feb 4 2014 Sergey Budnevitch <sb@nginx.com> +- 1.5.10 + +* Wed Jan 22 2014 Sergey Budnevitch <sb@nginx.com> +- 1.5.9 + +* Tue Dec 17 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.8 +- fixed invalid week days in the changelog + +* Tue Nov 19 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.7 + +* Tue Oct 1 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.6 + +* Tue Sep 17 2013 Andrei Belov <defan@nginx.com> +- 1.5.5 + +* Tue Aug 27 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.4 +- auth request module added + +* Tue Jul 30 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.3 + +* Tue Jul 2 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.2 + +* Tue Jun 4 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.1 + +* Mon May 6 2013 Sergey Budnevitch <sb@nginx.com> +- 1.5.0 + +* Tue Apr 16 2013 Sergey Budnevitch <sb@nginx.com> +- 1.3.16 + +* Tue Mar 26 2013 Sergey Budnevitch <sb@nginx.com> +- 1.3.15 +- gunzip module added +- set permissions on default log files at installation + +* Tue Feb 12 2013 Sergey Budnevitch <sb@nginx.com> +- excess slash removed from --prefix +- 1.2.7 + +* Tue Dec 11 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.6 + +* Tue Nov 13 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.5 + +* Tue Sep 25 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.4 + +* Tue Aug 7 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.3 +- nginx-debug package now actually contains non stripped binary + +* Tue Jul 3 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.2 + +* Tue Jun 5 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.1 + +* Mon Apr 23 2012 Sergey Budnevitch <sb@nginx.com> +- 1.2.0 + +* Thu Apr 12 2012 Sergey Budnevitch <sb@nginx.com> +- 1.0.15 + +* Thu Mar 15 2012 Sergey Budnevitch <sb@nginx.com> +- 1.0.14 +- OpenSUSE init script and SuSE specific changes to spec file added + +* Mon Mar 5 2012 Sergey Budnevitch <sb@nginx.com> +- 1.0.13 + +* Mon Feb 6 2012 Sergey Budnevitch <sb@nginx.com> +- 1.0.12 +- banner added to install script + +* Thu Dec 15 2011 Sergey Budnevitch <sb@nginx.com> +- 1.0.11 +- init script enhancements (thanks to Gena Makhomed) +- one second sleep during upgrade replaced with 0.1 sec usleep + +* Tue Nov 15 2011 Sergey Budnevitch <sb@nginx.com> +- 1.0.10 + +* Tue Nov 1 2011 Sergey Budnevitch <sb@nginx.com> +- 1.0.9 +- nginx-debug package added + +* Tue Oct 11 2011 Sergey Budnevitch <sb@nginx.com> +- spec file cleanup (thanks to Yury V. Zaytsev) +- log dir permitions fixed +- logrotate creates new logfiles with nginx owner +- "upgrade" argument to init-script added (based on fedora one) + +* Sat Oct 1 2011 Sergey Budnevitch <sb@nginx.com> +- 1.0.8 +- built with mp4 module + +* Fri Sep 30 2011 Sergey Budnevitch <sb@nginx.com> +- 1.0.7 + +* Tue Aug 30 2011 Sergey Budnevitch <sb@nginx.com> +- 1.0.6 +- replace "conf.d/*" config include with "conf.d/*.conf" in default nginx.conf + +* Wed Aug 10 2011 Sergey Budnevitch +- Initial release