From 84b0cb93c66956082e517c7c81c6047d52f58c50 Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Mon, 22 Sep 2014 12:07:39 +0100 Subject: [PATCH 1/3] Create nginx-filesystem subpackage (patch from Remi Collet) --- nginx.spec | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/nginx.spec b/nginx.spec index 74a73d8..d69da91 100644 --- a/nginx.spec +++ b/nginx.spec @@ -27,7 +27,7 @@ Name: nginx Epoch: 1 Version: 1.6.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A high performance web server and reverse proxy server Group: System Environment/Daemons @@ -66,12 +66,14 @@ BuildRequires: pcre-devel BuildRequires: perl-devel BuildRequires: perl(ExtUtils::Embed) BuildRequires: zlib-devel + +Requires: nginx-filesystem = %{epoch}:%{version}-%{release} Requires: GeoIP Requires: gd Requires: openssl Requires: pcre Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -Requires(pre): shadow-utils +Requires(pre): nginx-filesystem Provides: webserver %if 0%{?with_systemd} @@ -90,6 +92,17 @@ Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. +%package filesystem +Group: System Environment/Daemons +Summary: The basic directory layout for the Nginx server +BuildArch: noarch +Requires(pre): shadow-utils + +%description filesystem +The nginx-filesystem package contains the basic directory layout +for the Nginx server including the correct permissions for the +directories. + %prep %setup -q @@ -199,7 +212,7 @@ install -p -D -m 0755 %{SOURCE13} %{buildroot}%{_bindir}/nginx-upgrade install -p -D -m 0644 %{SOURCE14} %{buildroot}%{_mandir}/man8/nginx-upgrade.8 -%pre +%pre filesystem getent group %{nginx_group} > /dev/null || groupadd -r %{nginx_group} getent passwd %{nginx_user} > /dev/null || \ useradd -r -d %{nginx_home} -g %{nginx_group} \ @@ -242,7 +255,7 @@ fi %files %doc LICENSE CHANGES README -%{nginx_datadir}/ +%{nginx_datadir}/html/* %{_bindir}/nginx-upgrade %{_sbindir}/nginx %{_mandir}/man3/nginx.3pm* @@ -279,8 +292,17 @@ fi %attr(700,%{nginx_user},%{nginx_group}) %dir %{nginx_home_tmp} %attr(700,%{nginx_user},%{nginx_group}) %dir %{nginx_logdir} +%files filesystem +%dir %{nginx_datadir} +%dir %{nginx_datadir}/html +%dir %{nginx_confdir} +%dir %{nginx_confdir}/conf.d + %changelog +* Mon Sep 22 2014 Jamie Nguyen - 1:1.6.2-2 +- create nginx-filesystem subpackage (patch from Remi Collet) + * Wed Sep 17 2014 Jamie Nguyen - 1:1.6.2-1 - update to upstream release 1.6.2 - CVE-2014-3616 nginx: virtual host confusion (#1142573) From 24a935533768948eafa1b0baa75a133516ee4a2e Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Mon, 22 Sep 2014 12:10:59 +0100 Subject: [PATCH 2/3] Create /etc/nginx/default.d directory --- nginx.conf | 68 +++++------------------------------------------------- nginx.spec | 5 ++++ 2 files changed, 11 insertions(+), 62 deletions(-) diff --git a/nginx.conf b/nginx.conf index b2bbf14..ed521ca 100644 --- a/nginx.conf +++ b/nginx.conf @@ -35,15 +35,15 @@ http { #gzip on; + index index.html index.htm; + # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; - index index.html index.htm; - server { - listen 80; + listen 80 default_server; server_name localhost; root /usr/share/nginx/html; @@ -51,6 +51,9 @@ http { #access_log /var/log/nginx/host.access.log main; + # Load configuration files for the default server block. + include /etc/nginx/default.d/*.conf; + location / { } @@ -65,64 +68,5 @@ http { error_page 500 502 503 504 /50x.html; location = /50x.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; - #} } - - - # another virtual host using mix of IP-, name-, and port-based configuration - # - #server { - # listen 8000; - # listen somename:8080; - # server_name somename alias another.alias; - # root html; - - # location / { - # } - #} - - - # HTTPS server - # - #server { - # listen 443; - # server_name localhost; - # root html; - - # ssl on; - # ssl_certificate cert.pem; - # ssl_certificate_key cert.key; - - # ssl_session_timeout 5m; - - # ssl_protocols SSLv2 SSLv3 TLSv1; - # ssl_ciphers HIGH:!aNULL:!MD5; - # ssl_prefer_server_ciphers on; - - # location / { - # } - #} - } diff --git a/nginx.spec b/nginx.spec index d69da91..b3406c2 100644 --- a/nginx.spec +++ b/nginx.spec @@ -191,6 +191,7 @@ install -p -D -m 0644 %{SOURCE11} \ %{buildroot}%{_sysconfdir}/logrotate.d/nginx install -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d +install -p -d -m 0755 %{buildroot}%{nginx_confdir}/default.d install -p -d -m 0700 %{buildroot}%{nginx_home} install -p -d -m 0700 %{buildroot}%{nginx_home_tmp} install -p -d -m 0700 %{buildroot}%{nginx_logdir} @@ -297,11 +298,15 @@ fi %dir %{nginx_datadir}/html %dir %{nginx_confdir} %dir %{nginx_confdir}/conf.d +%dir %{nginx_confdir}/default.d %changelog * Mon Sep 22 2014 Jamie Nguyen - 1:1.6.2-2 - create nginx-filesystem subpackage (patch from Remi Collet) +- create /etc/nginx/default.d as a drop-in directory for configuration files + for the default server block +- clean up nginx.conf * Wed Sep 17 2014 Jamie Nguyen - 1:1.6.2-1 - update to upstream release 1.6.2 From 790674dc4a952df22a277d1c713be3026bda24a9 Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Wed, 22 Oct 2014 19:17:55 +0100 Subject: [PATCH 3/3] Add vim files (#1142849) --- nginx.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nginx.spec b/nginx.spec index b3406c2..8670648 100644 --- a/nginx.spec +++ b/nginx.spec @@ -27,7 +27,7 @@ Name: nginx Epoch: 1 Version: 1.6.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A high performance web server and reverse proxy server Group: System Environment/Daemons @@ -212,6 +212,11 @@ install -p -D -m 0644 %{_builddir}/nginx-%{version}/man/nginx.8 \ install -p -D -m 0755 %{SOURCE13} %{buildroot}%{_bindir}/nginx-upgrade install -p -D -m 0644 %{SOURCE14} %{buildroot}%{_mandir}/man8/nginx-upgrade.8 +for i in ftdetect indent syntax; do + install -p -D -m644 contrib/vim/${i}/nginx.vim \ + %{buildroot}%{_datadir}/vim/vimfiles/${i}/nginx.vim +done + %pre filesystem getent group %{nginx_group} > /dev/null || groupadd -r %{nginx_group} @@ -259,6 +264,9 @@ fi %{nginx_datadir}/html/* %{_bindir}/nginx-upgrade %{_sbindir}/nginx +%{_datadir}/vim/vimfiles/ftdetect/nginx.vim +%{_datadir}/vim/vimfiles/syntax/nginx.vim +%{_datadir}/vim/vimfiles/indent/nginx.vim %{_mandir}/man3/nginx.3pm* %{_mandir}/man8/nginx.8* %{_mandir}/man8/nginx-upgrade.8* @@ -302,6 +310,9 @@ fi %changelog +* Wed Oct 22 2014 Jamie Nguyen - 1:1.6.2-3 +- add vim files (#1142849) + * Mon Sep 22 2014 Jamie Nguyen - 1:1.6.2-2 - create nginx-filesystem subpackage (patch from Remi Collet) - create /etc/nginx/default.d as a drop-in directory for configuration files