[lighttpd] Fix server.max-fds and default configuration to have lighttpd start.

Matthias Saou thias at fedoraproject.org
Sun Jul 10 22:03:32 UTC 2011


commit 8681be02d7d1d99d0f1160a241257496b9677fae
Author: Matthias Saou <thias at marmotte.net>
Date:   Mon Jul 11 00:02:56 2011 +0200

    Fix server.max-fds and default configuration to have lighttpd start.

 lighttpd-1.4.28-defaultconf.patch |   13 +++++++-
 lighttpd.spec                     |   59 ++++++++++++++++++++-----------------
 2 files changed, 44 insertions(+), 28 deletions(-)
---
diff --git a/lighttpd-1.4.28-defaultconf.patch b/lighttpd-1.4.28-defaultconf.patch
index 350d1b8..12c6470 100644
--- a/lighttpd-1.4.28-defaultconf.patch
+++ b/lighttpd-1.4.28-defaultconf.patch
@@ -1,6 +1,6 @@
 diff -Naupr lighttpd-1.4.28.orig/doc/config/lighttpd.conf lighttpd-1.4.28/doc/config/lighttpd.conf
 --- lighttpd-1.4.28.orig/doc/config/lighttpd.conf	2010-07-11 19:01:32.000000000 +0200
-+++ lighttpd-1.4.28/doc/config/lighttpd.conf	2010-11-08 13:38:39.698064278 +0100
++++ lighttpd-1.4.28/doc/config/lighttpd.conf	2011-07-10 23:24:57.316465832 +0200
 @@ -14,7 +14,7 @@
  ## chroot example aswell.
  ##
@@ -19,3 +19,14 @@ diff -Naupr lighttpd-1.4.28.orig/doc/config/lighttpd.conf lighttpd-1.4.28/doc/co
  
  ##
  ## The value for the "Server:" response field.
+@@ -204,7 +204,9 @@ server.network-backend = "linux-sendfile
+ ## By default lighttpd would not change the operation system default.
+ ## But setting it to 2048 is a better default for busy servers.
+ ##
+-server.max-fds = 2048
++## With SELinux enabled, this is denied by default and needs to be allowed
++## before it can work.
++#server.max-fds = 2048
+ 
+ ##
+ ## Stat() call caching.
diff --git a/lighttpd.spec b/lighttpd.spec
index 88532cb..f345f8a 100644
--- a/lighttpd.spec
+++ b/lighttpd.spec
@@ -6,7 +6,7 @@
 Summary: Lightning fast webserver with light system requirements
 Name: lighttpd
 Version: 1.4.28
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://www.lighttpd.net/
@@ -98,8 +98,8 @@ Virtual host module for lighttpd that uses a MySQL database.
 %setup -q
 %patch0 -p1 -b .defaultconf
 %patch1 -p1 -b .mod_geoip
-%{__install} -p -m 0644 %{SOURCE100} src/mod_geoip.c
-%{__install} -p -m 0644 %{SOURCE101} mod_geoip.txt
+install -p -m 0644 %{SOURCE100} src/mod_geoip.c
+install -p -m 0644 %{SOURCE101} mod_geoip.txt
 
 
 %build
@@ -114,55 +114,54 @@ Virtual host module for lighttpd that uses a MySQL database.
     %{!?_without_gdbm:--with-gdbm} \
     %{?_with_memcache:--with-memcache} \
     %{?!_without_lua:--with-lua}
-%{__make} %{?_smp_mflags}
+make %{?_smp_mflags}
 
 
 %install
-%{__rm} -rf %{buildroot}
-%{__make} install DESTDIR=%{buildroot}
-
-# Install (*patched above*) sample config file
-%{__install} -D -p -m 0640 doc/config/lighttpd.conf \
-    %{buildroot}%{_sysconfdir}/lighttpd/lighttpd.conf
-%{__mkdir_p} %{buildroot}%{_sysconfdir}/lighttpd/conf.d
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
 
 # Install our own logrotate entry
-%{__install} -D -p -m 0644 %{SOURCE1} \
+install -D -p -m 0644 %{SOURCE1} \
     %{buildroot}%{_sysconfdir}/logrotate.d/lighttpd
 
 # Install our own php.d ini file
-%{__install} -D -p -m 0644 %{SOURCE2} \
+install -D -p -m 0644 %{SOURCE2} \
     %{buildroot}%{_sysconfdir}/php.d/lighttpd.ini
 
 # Install our own init script (the included one is old style)
-%{__install} -D -p -m 0755 %{SOURCE3} \
+install -D -p -m 0755 %{SOURCE3} \
     %{buildroot}%{_sysconfdir}/rc.d/init.d/lighttpd
 
 # Install our own default web page and images
-%{__mkdir_p} %{buildroot}%{webroot}
-%{__install} -p -m 0644 %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \
+mkdir -p %{buildroot}%{webroot}
+install -p -m 0644 %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \
     %{buildroot}%{webroot}/
 
 # Symlink for the powered-by-$DISTRO image (install empty image on RHEL)
 %if 0%{!?rhel:1}
-%{__ln_s} %{_datadir}/pixmaps/poweredby.png \
+ln -s %{_datadir}/pixmaps/poweredby.png \
 %else
-%{__install} -p -m 0644 %{SOURCE14} \
+install -p -m 0644 %{SOURCE14} \
 %endif
     %{buildroot}%{webroot}/poweredby.png
 
 # Example configuration to be included as %%doc
-%{__rm} -rf config
-%{__cp} -a doc/config config
+rm -rf config
+cp -a doc/config config
 find config -name 'Makefile*' | xargs rm -f
 # Remove +x from scripts to be included as %%doc to avoid auto requirement
-%{__chmod} -x doc/scripts/*.sh
+chmod -x doc/scripts/*.sh
+
+# Install (*patched above*) sample config files
+mkdir -p %{buildroot}%{_sysconfdir}/lighttpd
+cp -a config/*.conf config/*.d %{buildroot}%{_sysconfdir}/lighttpd/
 
 # Install empty log directory to include
-%{__mkdir_p} %{buildroot}%{_var}/log/lighttpd
+mkdir -p %{buildroot}%{_var}/log/lighttpd
 
 # Install empty run directory to include (for the example fastcgi socket)
-%{__mkdir_p} %{buildroot}%{_var}/run/lighttpd
+mkdir -p %{buildroot}%{_var}/run/lighttpd
 %if 0%{?fedora} >= 15
 # Setup tmpfiles.d config for the above
 mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d
@@ -172,7 +171,7 @@ echo 'D /var/run/lighttpd 0750 lighttpd lighttpd -' > \
 
 
 %clean
-%{__rm} -rf %{buildroot}
+rm -rf %{buildroot}
 
 
 %pre
@@ -200,7 +199,11 @@ fi
 %doc doc/*.txt config/ doc/scripts/rrdtool-graph.sh
 %dir %{_sysconfdir}/lighttpd/
 %dir %{_sysconfdir}/lighttpd/conf.d/
-%config(noreplace) %{_sysconfdir}/lighttpd/lighttpd.conf
+%dir %{_sysconfdir}/lighttpd/vhosts.d/
+%config(noreplace) %{_sysconfdir}/lighttpd/*.conf
+%config(noreplace) %{_sysconfdir}/lighttpd/conf.d/*.conf
+%config %{_sysconfdir}/lighttpd/conf.d/mod.template
+%config %{_sysconfdir}/lighttpd/vhosts.d/vhosts.template
 %config(noreplace) %{_sysconfdir}/logrotate.d/lighttpd
 %{_sysconfdir}/rc.d/init.d/lighttpd
 %if 0%{?fedora} >= 15
@@ -247,11 +250,13 @@ fi
 
 
 %changelog
-* Sat Jul  9 2011 Matthias Saou <http://freshrpms.net/> 1.4.28-1
-- Rebase F15 master to the 1.4.28 update
+* Sat Jul  9 2011 Matthias Saou <http://freshrpms.net/> 1.4.28-2
+- Rebase F15 master to the 1.4.28 update.
 - Try to update to 1.4.29 (#625737).
 - Rebase geoip patch for 1.4.29.
 - Update /var/run to work with F15+ (#656612).
+- Include all of the new example configuration, with conf.d files and vhosts.d.
+- Disable server.max-fds by default since SELinux denies it.
 
 * Wed Mar 23 2011 Dan Horák <dan at danny.cz> - 1.4.26-4
 - rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)


More information about the scm-commits mailing list