Browse Source

fine tune lighttp config

Waldemar Brodkorb 14 years ago
parent
commit
ebc6f3b2cc

+ 2 - 1
package/lighttpd/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		lighttpd
 PKG_VERSION:=		1.4.28
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MD5SUM:=		202d36efc6324adb95a3600d2826ec6a
 PKG_DESCR:=		a lightweight web server
 PKG_SECTION:=		www
@@ -88,6 +88,7 @@ CONFIGURE_ARGS+=	--libdir=/usr/lib/lighttpd \
 post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
 	${INSTALL_DIR} $(IDIR_LIGHTTPD)/etc/lighttpd/conf.d
 	${INSTALL_DATA} ./files/lighttpd.conf $(IDIR_LIGHTTPD)/etc/lighttpd
+	${INSTALL_DATA} ./files/modules.conf $(IDIR_LIGHTTPD)/etc/lighttpd
 	${CP} ${WRKBUILD}/doc/config/conf.d/*.conf \
 		$(IDIR_LIGHTTPD)/etc/lighttpd/conf.d
 	${INSTALL_DIR} $(IDIR_LIGHTTPD)/usr/lib/lighttpd

+ 3 - 3
package/lighttpd/files/lighttpd.conf

@@ -90,7 +90,7 @@ server.port = 80
 ##
 ## Use IPv6?
 ##
-server.use-ipv6 = "enable"
+server.use-ipv6 = "disable"
 
 ##
 ## bind to a specific IP
@@ -188,7 +188,7 @@ server.event-handler = "linux-sysepoll"
 ## linux-sendfile - is recommended for small files.
 ## writev         - is recommended for sending many large files
 ##
-server.network-backend = "linux-sendfile"
+#server.network-backend = "linux-sendfile"
 
 ##
 ## As lighttpd is a single-threaded server, its main resource limit is
@@ -305,7 +305,7 @@ index-file.names += (
 ## ~    is for backupfiles from vi, emacs, joe, ...
 ## .inc is often used for code includes which should in general not be part
 ##      of the document-root
-url.access-deny             = ( "~", ".inc" )
+#url.access-deny             = ( "~", ".inc" )
 
 ##
 ## disable range requests for pdf files

+ 1 - 0
package/lighttpd/files/lighttpd.conffiles

@@ -1 +1,2 @@
 /etc/lighttpd/lighttpd.conf
+/etc/lighttpd/modules.conf

+ 2 - 1
package/lighttpd/files/lighttpd.init

@@ -1,7 +1,6 @@
 #!/bin/sh
 #PKG lighttpd
 #INIT 60
-
 . /etc/rc.conf
 
 case $1 in
@@ -11,6 +10,8 @@ autostart)
 	exec sh $0 start
 	;;
 start)
+	[ ! -d /srv/www ] && echo "You need to create /srv/www/htdocs"
+	mkdir -p /var/log/lighttpd && chown lighttpd.lighttpd /var/log/lighttpd
 	/usr/sbin/lighttpd $lighttpd_flags
 	;;
 stop)

+ 3 - 0
package/lighttpd/files/lighttpd.postinst

@@ -2,3 +2,6 @@
 . $IPKG_INSTROOT/etc/functions.sh
 add_rcconf lighttpd lighttpd NO
 add_rcconf lighttpd_flags lighttpd_flags "-f /etc/lighttpd/lighttpd.conf"
+gid=$(get_next_gid)
+add_user lighttpd $(get_next_uid) $gid /srv/www
+add_group lighttpd $gid

+ 172 - 0
package/lighttpd/files/modules.conf

@@ -0,0 +1,172 @@
+#######################################################################
+##
+##  Modules to load
+## -----------------
+##
+## at least mod_access and mod_accesslog should be loaded
+## all other module should only be loaded if really neccesary
+##
+## - saves some time
+## - saves memory
+##
+## the default module set contains:
+##
+## "mod_indexfile", "mod_dirlisting", "mod_staticfile"
+##
+## you dont have to include those modules in your list
+##
+## Modules, which are pulled in via conf.d/*.conf
+##
+## NOTE: the order of modules is important.
+##
+## - mod_accesslog     -> conf.d/access_log.conf
+## - mod_compress      -> conf.d/compress.conf
+## - mod_status        -> conf.d/status.conf
+## - mod_webdav        -> conf.d/webdav.conf
+## - mod_cml           -> conf.d/cml.conf
+## - mod_evhost        -> conf.d/evhost.conf
+## - mod_simple_vhost  -> conf.d/simple_vhost.conf
+## - mod_mysql_vhost   -> conf.d/mysql_vhost.conf
+## - mod_trigger_b4_dl -> conf.d/trigger_b4_dl.conf
+## - mod_userdir       -> conf.d/userdir.conf
+## - mod_rrdtool       -> conf.d/rrdtool.conf
+## - mod_ssi           -> conf.d/ssi.conf
+## - mod_cgi           -> conf.d/cgi.conf
+## - mod_scgi          -> conf.d/scgi.conf
+## - mod_fastcgi       -> conf.d/fastcgi.conf
+## - mod_proxy         -> conf.d/proxy.conf
+## - mod_secdownload   -> conf.d/secdownload.conf
+## - mod_expire        -> conf.d/expire.conf
+##
+
+server.modules = (
+#  "mod_access",
+#  "mod_alias",
+#  "mod_auth",
+#  "mod_evasive",
+#  "mod_redirect",
+#  "mod_rewrite",
+#  "mod_setenv",
+#  "mod_usertrack",
+)
+
+##
+#######################################################################
+
+#######################################################################
+##
+##  Config for various Modules
+##
+
+##
+## mod_ssi
+##
+#include "conf.d/ssi.conf"
+
+##
+## mod_status
+##
+#include "conf.d/status.conf"
+
+##
+## mod_webdav
+##
+#include "conf.d/webdav.conf"
+
+##
+## mod_compress
+##
+#include "conf.d/compress.conf"
+
+##
+## mod_userdir
+##
+#include "conf.d/userdir.conf"
+
+##
+## mod_magnet
+##
+#include "conf.d/magnet.conf"
+
+##
+## mod_cml
+##
+#include "conf.d/cml.conf"
+
+##
+## mod_rrdtool
+##
+#include "conf.d/rrdtool.conf"
+
+##
+## mod_proxy
+##
+#include "conf.d/proxy.conf"
+
+##
+## mod_expire
+##
+#include "conf.d/expire.conf"
+
+##
+## mod_secdownload
+##
+#include "conf.d/secdownload.conf"
+
+##
+#######################################################################
+
+#######################################################################
+##
+## CGI modules
+##
+
+##
+## SCGI (mod_scgi)
+##
+#include "conf.d/scgi.conf"
+
+##
+## FastCGI (mod_fastcgi)
+##
+#include "conf.d/fastcgi.conf"
+
+##
+## plain old CGI (mod_cgi)
+##
+#include "conf.d/cgi.conf"
+
+##
+#######################################################################
+
+#######################################################################
+##
+## VHost Modules
+##
+##  Only load ONE of them!
+## ========================
+##
+
+##
+## You can use conditionals for vhosts aswell.
+## 
+## see http://www.lighttpd.net/documentation/configuration.html
+##
+
+##
+## mod_evhost
+##
+#include "conf.d/evhost.conf"
+
+##
+## mod_simple_vhost
+##
+#include "conf.d/simple_vhost.conf"
+
+##
+## mod_mysql_vhost
+##
+#include "conf.d/mysql_vhost.conf"
+
+##
+#######################################################################