summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-09-23 17:57:31 +0200
committerRemi Collet <fedora@famillecollet.com>2014-09-23 17:57:31 +0200
commit96d5500b130427195d0d3d4259d03faf83204a56 (patch)
tree6758e312a24c14a4c6de8a7429065cf76bda364d
parentfc01aa049d89ecb6470fa5c67c2158ffe8c8c5f4 (diff)
php 5.6: provides nginx configuration
-rw-r--r--nginx-fpm.conf6
-rw-r--r--nginx-php.conf14
-rw-r--r--php56.spec30
3 files changed, 49 insertions, 1 deletions
diff --git a/nginx-fpm.conf b/nginx-fpm.conf
new file mode 100644
index 0000000..5b5f9be
--- /dev/null
+++ b/nginx-fpm.conf
@@ -0,0 +1,6 @@
+# PHP-FPM FastCGI server
+# network or unix domain socket configuration
+
+upstream php-fpm {
+ server 127.0.0.1:9000;
+}
diff --git a/nginx-php.conf b/nginx-php.conf
new file mode 100644
index 0000000..9b01536
--- /dev/null
+++ b/nginx-php.conf
@@ -0,0 +1,14 @@
+# pass the PHP scripts to FastCGI server
+#
+# See conf.d/php-fpm.conf for socket configuration
+#
+index index.php index.html index.htm;
+
+location ~ \.php$ {
+ try_files $uri =404;
+ fastcgi_intercept_errors on;
+ fastcgi_index index.php;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_pass php-fpm;
+}
diff --git a/php56.spec b/php56.spec
index f764a9e..96c1534 100644
--- a/php56.spec
+++ b/php56.spec
@@ -99,6 +99,12 @@
%else
%global with_httpd2410 0
%endif
+# nginx 1.6 with nginx-filesystem
+%if 0%{?fedora} >= 21
+%global with_nginx 1
+%else
+%global with_nginx 0
+%endif
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
%global with_dtrace 1
@@ -127,7 +133,7 @@ Summary: PHP scripting language for creating dynamic web sites
Name: php
Version: 5.6.1
%if 0%{?snapdate:1}%{?rcver:1}
-Release: 0.1.%{?snapdate}%{?rcver}%{?dist}
+Release: 0.2.%{?snapdate}%{?rcver}%{?dist}
%else
Release: 1%{?dist}.2
%endif
@@ -158,6 +164,8 @@ Source9: php.modconf
Source10: php.ztsmodconf
Source11: strip.sh
Source12: php.conf2
+Source13: nginx-fpm.conf
+Source14: nginx-php.conf
# Configuration files for some extensions
Source50: opcache.ini
Source51: opcache-default.blacklist
@@ -208,6 +216,10 @@ BuildRequires: httpd-devel >= 2.0.46-1, pam-devel
# to ensure we are using httpd with filesystem feature (see #1081453)
BuildRequires: httpd-filesystem
%endif
+%if %{with_nginx}
+# to ensure we are using nginx with filesystem feature (see #1142298)
+BuildRequires: nginx-filesystem
+%endif
BuildRequires: libstdc++-devel, openssl-devel
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
# For Sqlite3 extension
@@ -334,6 +346,10 @@ Requires: httpd-filesystem >= 2.4.10
# php engine for Apache httpd webserver
Provides: php(httpd)
%endif
+%if %{with_nginx}
+# for /etc/nginx ownership
+Requires: nginx-filesystem
+%endif
Obsoletes: php53-fpm, php53u-fpm, php54-fpm, php54w-fpm, php55u-fpm, php55w-fpm, php56u-fpm, php56w-fpm
%description fpm
@@ -1539,6 +1555,11 @@ sed -i -e 's:/run:/var/run:' $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/php-fpm
install -m 755 -d $RPM_BUILD_ROOT%{_initrddir}
install -m 755 %{SOURCE99} $RPM_BUILD_ROOT%{_initrddir}/php-fpm
%endif
+%if %{with_nginx}
+# Nginx configuration
+install -D -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/php-fpm.conf
+install -D -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/default.d/php.conf
+%endif
# Fix the link
(cd $RPM_BUILD_ROOT%{_bindir}; ln -sfn phar.phar phar)
@@ -1830,6 +1851,10 @@ fi
%config(noreplace) %{_sysconfdir}/php-fpm.d/www.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/php-fpm
%config(noreplace) %{_sysconfdir}/sysconfig/php-fpm
+%if %{with_nginx}
+%config(noreplace) %{_sysconfdir}/nginx/conf.d/php-fpm.conf
+%config(noreplace) %{_sysconfdir}/nginx/default.d/php.conf
+%endif
%if %{with_systemd}
%{_prefix}/lib/tmpfiles.d/php-fpm.conf
%{_unitdir}/php-fpm.service
@@ -1917,6 +1942,9 @@ fi
%changelog
+* Tue Sep 24 2014 Remi Collet <rcollet@redhat.com> 5.6.1-0.2.RC1
+- provides nginx configuration (see #1142298)
+
* Fri Sep 12 2014 Remi Collet <rcollet@redhat.com> 5.6.1-0.1.RC1
- php 5.6.1RC1