diff options
author | Paul Wisehart <wise@lupulin.net> | 2010-05-12 17:43:42 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-12 17:43:42 +0200 |
commit | 33600556ed1dca13f60555278b06e6c14d074cea (patch) | |
tree | d23255828a059fbe7a3ac9c0e23e31ed492163f4 /network/lighttpd | |
parent | 53979f7b2ebfe5f96ff3f7e9f23dcad7fcd7939a (diff) |
network/lighttpd: Updated for version 1.4.22
Diffstat (limited to 'network/lighttpd')
-rw-r--r-- | network/lighttpd/README | 55 | ||||
-rw-r--r-- | network/lighttpd/README.SLACKWARE | 44 | ||||
-rw-r--r-- | network/lighttpd/doinst.sh | 24 | ||||
-rw-r--r-- | network/lighttpd/lighttpd.SlackBuild | 36 | ||||
-rw-r--r-- | network/lighttpd/lighttpd.conf | 6 | ||||
-rw-r--r-- | network/lighttpd/lighttpd.info | 8 | ||||
-rw-r--r-- | network/lighttpd/lighttpd.logrotate | 1 | ||||
-rw-r--r-- | network/lighttpd/rc.lighttpd | 2 |
8 files changed, 101 insertions, 75 deletions
diff --git a/network/lighttpd/README b/network/lighttpd/README index d8623f000f43..62ca3b139d23 100644 --- a/network/lighttpd/README +++ b/network/lighttpd/README @@ -7,54 +7,9 @@ By default, this package uses the "lighttpd" user and group to run lighttpd as a unpriviliged process. The script will exit if these do not exist on this machine. We recommend using the following UID and GID as they do not conflict with any stock Slackware users -and groups, nor with any added by other slackbuilds.org scripts. +and groups, nor with any added by other SlackBuilds.org scripts. + User: lighttpd UID: 208 GID: 208 + Group: lighttpd GID: 208 - lighttpd - ======== - User: lighttpd UID: 208 GID: 208 - Group: lighttpd GID: 208 - -After that, lighttpd can be started and stopped through the -initialization script that is provided: - -/etc/rc.d/rc.lighttpd start -/etc/rc.d/rc.lighttpd stop - -If you would like to start lighttpd automatically when the system -is booted, add the following lines to /etc/rc.d/rc.local: - - if [ -x /etc/rc.d/rc.lighttpd ]; then - /etc/rc.d/rc.lighttpd start - fi - -Conversely, add the following lines to /etc/rc.d/rc.local_shutdown -to stop lighttpd on system shutdown. - - if [ -x /etc/rc.d/rc.lighttpd ]; then - /etc/rc.d/rc.lighttpd stop - fi - -* PHP users: -Slackware's default php package is meant to work with -httpd(apache). It works fine with lighttpd with a couple of tweaks. - -1) Copy the php.ini from /etc/httpd to /etc/lighttpd - -2) Uncomment mod_fastcgi from the modules section of -/etc/lighttpd/lighttpd.conf. - -3) Rework the fastcgi section of /etc/lighttpd/lighttpd.conf to the -following: (Or just copy this in below the extisting commented out -fastcgi config.) - -fastcgi.server = ( ".php" => - ( "localhost" => - ( - "socket" => "/tmp/php-fastcgi.socket", - "bin-path" => "/usr/bin/php-cgi -c /etc/lighttpd/php.ini" - ) - ) - ) - -4) Change the group of /var/lib/php from "apache" to "lighttpd". -Otherwise php won't be able to use $_SESSION. +Be sure to see README.SLACKWARE (in this directory, and also installed +with the package documentation) for configuration and setup information. diff --git a/network/lighttpd/README.SLACKWARE b/network/lighttpd/README.SLACKWARE new file mode 100644 index 000000000000..6f6f39dd6e86 --- /dev/null +++ b/network/lighttpd/README.SLACKWARE @@ -0,0 +1,44 @@ +README.SLACKWARE For lighttpd (20090217) + +lighttpd can be started and stopped through the initialization script that +is provided: + /etc/rc.d/rc.lighttpd start + /etc/rc.d/rc.lighttpd stop + +If you would like to start lighttpd automatically when the system +is booted, add the following lines to /etc/rc.d/rc.local: + if [ -x /etc/rc.d/rc.lighttpd ]; then + /etc/rc.d/rc.lighttpd start + fi + +Conversely, add the following lines to /etc/rc.d/rc.local_shutdown +to stop lighttpd on system shutdown. + if [ -x /etc/rc.d/rc.lighttpd ]; then + /etc/rc.d/rc.lighttpd stop + fi + +* PHP users: +Slackware's default php package is meant to work with +httpd(apache). It works fine with lighttpd with a couple of tweaks. + +1) Copy the php.ini from /etc/httpd to /etc/lighttpd + +2) Uncomment mod_fastcgi from the modules section of + /etc/lighttpd/lighttpd.conf. + +3) Rework the fastcgi section of /etc/lighttpd/lighttpd.conf to the + following (or just copy this in below the existing commented out + fastcgi config): + + fastcgi.server = ( ".php" => + ( "localhost" => + ( + "socket" => "/var/run/lighttpd/php-fastcgi.socket", + "bin-path" => "/usr/bin/php-cgi -c /etc/lighttpd/php.ini" + ) + ) + ) + +4) Change the group of /var/lib/php from "apache" to "lighttpd". + Otherwise, php won't be able to use $_SESSION. + diff --git a/network/lighttpd/doinst.sh b/network/lighttpd/doinst.sh index 172a5987b9cc..f606c2f077a7 100644 --- a/network/lighttpd/doinst.sh +++ b/network/lighttpd/doinst.sh @@ -1,17 +1,33 @@ -#!/bin/sh - config() { NEW="$1" - OLD="`dirname $NEW`/`basename $NEW .new`" + OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD - elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } +# Keep same perms on rc.lighttpd.new: +if [ -e etc/rc.d/rc.lighttpd ]; then + cp -a etc/rc.d/rc.lighttpd etc/rc.d/rc.lighttpd.new.incoming + cat etc/rc.d/rc.lighttpd.new > etc/rc.d/rc.lighttpd.new.incoming + mv etc/rc.d/rc.lighttpd.new.incoming etc/rc.d/rc.lighttpd.new +fi + config etc/lighttpd/lighttpd.conf.new config etc/logrotate.d/lighttpd.new config etc/rc.d/rc.lighttpd.new + +# Create dummy logfiles, but throw them away if logfiles are already here: +for i in access error ; do + if [ -e var/log/lighttpd/${i}.log ]; then + rm -f var/log/lighttpd/${i}.log.new + else + mv var/log/lighttpd/${i}.log.new var/log/lighttpd/${i}.log + fi +done + diff --git a/network/lighttpd/lighttpd.SlackBuild b/network/lighttpd/lighttpd.SlackBuild index 2d88a0d794a0..cf491dea7248 100644 --- a/network/lighttpd/lighttpd.SlackBuild +++ b/network/lighttpd/lighttpd.SlackBuild @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=lighttpd -VERSION=1.4.20 +VERSION=1.4.22 ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -38,15 +38,15 @@ OUTPUT=${OUTPUT:-/tmp} LIGHTTPD_USER=${LIGHTTPD_USER:-lighttpd} LIGHTTPD_GROUP=${LIGHTTPD_GROUP:-lighttpd} -if ! grep ^$LIGHTTPD_GROUP: /etc/group > /dev/null 2>&1; then - echo "$0: Error: LIGHTTP group ($LIGHTTPD_GROUP) doesn't exist." - echo "$0: Try creating one with: groupadd -g 208 $LIGHTTPD_GROUP" +if ! grep -q ^$LIGHTTPD_GROUP: /etc/group 2>/dev/null ; then + echo " Error: LIGHTTPD group ($LIGHTTPD_GROUP) doesn't exist." + echo " Try creating one with: groupadd -g 208 $LIGHTTPD_GROUP" exit 1 fi -if ! grep ^$LIGHTTPD_USER: /etc/passwd > /dev/null 2>&1; then - echo "$0: Error: LIGHTTP user ($LIGHTTPD_USER) doesn't exist." - echo "$0: Try creating one with: useradd -u 208 -g $LIGHTTPD_GROUP -d /var/www $LIGHTTPD_USER" +if ! grep -q ^$LIGHTTPD_USER: /etc/passwd 2>/dev/null ; then + echo " Error: LIGHTTPD user ($LIGHTTPD_USER) doesn't exist." + echo " Try creating one with: useradd -u 208 -g $LIGHTTPD_GROUP -d /var/www $LIGHTTPD_USER" exit 1 fi @@ -64,7 +64,7 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . chmod -R u+w,go+r-w,a-s . @@ -79,7 +79,8 @@ CXXFLAGS="$SLKCFLAGS" \ --mandir=/usr/man \ --with-pcre \ --with-attr \ - --with-openssl + --with-openssl \ + --build=$ARCH-slackware-linux make make install-strip DESTDIR=$PKG @@ -87,12 +88,23 @@ make install-strip DESTDIR=$PKG mkdir -p $PKG/var/{cache,log}/$PRGNAM chmod 0700 $PKG/var/cache/lighttpd mkdir -p $PKG/var/www/htdocs-lighttpd -touch $PKG/var/log/lighttpd/{access,error}.log +touch $PKG/var/log/lighttpd/{access,error}.log.new + +# We'll create this, even though it will be empty by default, because +# our suggested fastcgi path will use this as the socket directory +# instead of /tmp (to avoid symlink attacks and such) +# This is also the default directory used for the pid file now +# (configurable in lighttpd.conf) +mkdir -p $PKG/var/run/lighttpd +chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PKG/var/run/lighttpd install -D -m 0755 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new install -D -m 0644 $CWD/$PRGNAM.conf $PKG/etc/$PRGNAM/$PRGNAM.conf.new install -D -m 0644 $CWD/$PRGNAM.logrotate $PKG/etc/logrotate.d/lighttpd.new +chown -R $LIGHTTPD_USER:$LIGHTTPD_GROUP $PKG/var/log/lighttpd/ +chown -R $LIGHTTPD_USER:$LIGHTTPD_GROUP $PKG/var/cache/lighttpd + ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done @@ -102,14 +114,12 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README doc/* \ $PKG/usr/doc/$PRGNAM-$VERSION rm -f $PKG/usr/doc/$PRGNAM-$VERSION/Makefile* +cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh -chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PKG/var/log/lighttpd/{access,error}.log -chown -R $LIGHTTPD_USER:$LIGHTTPD_GROUP $PKG/var/cache/lighttpd - cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/lighttpd/lighttpd.conf b/network/lighttpd/lighttpd.conf index 05aa41914232..0565ef3aeb5c 100644 --- a/network/lighttpd/lighttpd.conf +++ b/network/lighttpd/lighttpd.conf @@ -145,7 +145,7 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) #server.error-handler-404 = "/error-handler.php" ## to help the rc.scripts -server.pid-file = "/var/run/lighttpd.pid" +server.pid-file = "/var/run/lighttpd/lighttpd.pid" ###### virtual hosts @@ -209,8 +209,8 @@ server.groupname = "lighttpd" #fastcgi.server = ( ".php" => # ( "localhost" => # ( -# "socket" => "/tmp/php-fastcgi.socket", -# "bin-path" => "/usr/local/bin/php" +# "socket" => "/var/run/lighttpd/php-fastcgi.socket", +# "bin-path" => "/usr/bin/php" # ) # ) # ) diff --git a/network/lighttpd/lighttpd.info b/network/lighttpd/lighttpd.info index 1073938cd1ec..7edb25ad2df7 100644 --- a/network/lighttpd/lighttpd.info +++ b/network/lighttpd/lighttpd.info @@ -1,8 +1,8 @@ PRGNAM="lighttpd" -VERSION="1.4.20" +VERSION="1.4.22" HOMEPAGE="http://www.lighttpd.net/" -DOWNLOAD="http://www.lighttpd.net/download/lighttpd-1.4.20.tar.bz2" -MD5SUM="ed6ee0bb714f393219a32768d86984d8" +DOWNLOAD="http://www.lighttpd.net/download/lighttpd-1.4.22.tar.gz" +MD5SUM="949c33a81e83f7718a47280bef21b90c" MAINTAINER="paul wisehart" EMAIL="wise@lupulin.net" -APPROVED="David Somero" +APPROVED="rworkman" diff --git a/network/lighttpd/lighttpd.logrotate b/network/lighttpd/lighttpd.logrotate index 598650a1f22d..65c13f36c8b8 100644 --- a/network/lighttpd/lighttpd.logrotate +++ b/network/lighttpd/lighttpd.logrotate @@ -3,6 +3,7 @@ missingok copytruncate rotate 7 + create 0644 lighttpd lighttpd compress notifempty sharedscripts diff --git a/network/lighttpd/rc.lighttpd b/network/lighttpd/rc.lighttpd index 2f31a40e69ce..919f6b210425 100644 --- a/network/lighttpd/rc.lighttpd +++ b/network/lighttpd/rc.lighttpd @@ -21,7 +21,7 @@ # LIGHTTPD=/usr/sbin/lighttpd -PIDFILE=/var/run/lighttpd.pid +PIDFILE=/var/run/lighttpd/lighttpd.pid LIGHTTPD_OPTIONS="-f /etc/lighttpd/lighttpd.conf" is_pidof() { |