# HG changeset patch # User Christophe Lincoln # Date 1488882976 -3600 # Node ID 58aea7b2f30783a77c2b138b4cff9ffc14556f09 # Parent ff5c597e5d111d514f7961b4ddb0b20bc68fb978 Add lighty custom config file and imprive pkg diff -r ff5c597e5d11 -r 58aea7b2f307 packages/lighttpd --- a/packages/lighttpd Tue Mar 07 10:51:02 2017 +0100 +++ b/packages/lighttpd Tue Mar 07 11:36:16 2017 +0100 @@ -5,11 +5,19 @@ seb_install() { install_files "/usr/sbin/lighttpd" "/usr/lib/libpcre.so*" - mkdir -p ${rootfs}/etc/lighttpd # Configs - cp -f /etc/lighttpd/lighttpd.conf ${rootfs}/etc/lighttpd - cp -f /etc/lighttpd/vhosts.conf ${rootfs}/etc/lighttpd + mkdir -p ${rootfs}/etc/lighttpd + cp -f ${tools}/lighttpd.conf ${rootfs}/etc/lighttpd + + # Default modules + install_files \ + "/usr/lib/lighttpd/mod_access*" \ + "/usr/lib/lighttpd/mod_alias.so" \ + "/usr/lib/lighttpd/mod_cgi.so" \ + "/usr/lib/lighttpd/mod_dirlisting.so" \ + "/usr/lib/lighttpd/mod_indexfile.so" \ + "/usr/lib/lighttpd/mod_userdir.so" # Daemon start function cat > ${rootfs}/etc/daemons/lighttpd << EOT diff -r ff5c597e5d11 -r 58aea7b2f307 seb --- a/seb Tue Mar 07 10:51:02 2017 +0100 +++ b/seb Tue Mar 07 11:36:16 2017 +0100 @@ -116,8 +116,11 @@ install_files() { for file in ${@} ; do path=$(dirname $file) + if [ ! -d "${rootfs}${path}" ]; then + mkdir -p ${rootfs}${path} + fi echo -n "Installing: $file" - cp -a ${file} ${rootfs}${path} && check + cp -a ${file} ${rootfs}${path}; check done } diff -r ff5c597e5d11 -r 58aea7b2f307 tools/lighttpd.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/lighttpd.conf Tue Mar 07 11:36:16 2017 +0100 @@ -0,0 +1,132 @@ +# /etc/lighttpd/lighttpd.conf: SliTaz LightTPD +# +# Web server configuration file. +# + +# Root documents. +server.document-root = "/var/www/" + +# Port, default for HTTP traffic is 80. +server.port = 80 + +# Server, user and group name. +server.username = "www" +server.groupname = "www" + +# Server header. +# Be nice and keep it at lighttpd and SliTaz GNU/Linux. +server.tag = "lighttpd (SliTaz GNU/Linux)" + +# Directory listings. +dir-listing.activate = "enable" +dir-listing.encoding = "iso8859-1" + +# File to open by default. +# +index-file.names = ( "index.html","index.php", "index.cgi", "index.sh" ) + +# Log messages. +# +accesslog.filename = "/var/log/lighttpd/access.log" +server.errorlog = "/var/log/lighttpd/error.log" + +# Server pid file +server.pid-file = "/var/run/lighttpd.pid" + +# MIME type. +mimetype.assign = ( + ".html" => "text/html", + ".txt" => "text/plain", + ".js" => "text/javascript", + ".css" => "text/css", + ".xml" => "text/xml", + ".diff" => "text/plain", + ".patch" => "text/plain", + ".list" => "text/plain", + ".log" => "text/plain", + ".conf" => "text/plain", + ".pdf" => "application/pdf", + ".ps" => "application/postscript", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".png" => "image/png", + ".gif" => "image/gif", + ".xbm" => "image/x-xbitmap", + ".xpm" => "image/x-xpixmap", + ".gz" => "application/x-gzip", + ".tar.gz" => "application/x-tgz", + ".torrent" => "application/x-bittorrent", + ".ogg" => "application/ogg", + ".cooklist" => "text/plain", + ".tazpkg" => "application/x-tazpkg", + ".sup" => "application/x-sup", + "README" => "text/plain", + "receipt" => "text/plain", +) + +# Deny access the file-extensions. +url.access-deny = ( "~", ".inc" ) + +# Modules to load. +# See /usr/lib/lighttpd for all available modules. +# "mod_status", "mod_fastcgi", "mod_rewrite", +server.modules = ( + "mod_access", + "mod_accesslog", + "mod_alias", + "mod_cgi", + "mod_userdir" +) + +# User directory module. +userdir.path = "Public" +userdir.exclude-user = ("root") + +# Status module. +#status.status-url = "/server-status" + +# Compress module +#compress.cache-dir = "/var/cache/lighttpd/compress/" +#compress.filetype = ("text/plain", "text/html") + +# CGI module. You can install Perl and assign .pl and .cgi script +# to /usr/bin/perl or Python: ".py" => "/usr/bin/python" +$HTTP["url"] =~ "/cgi-bin/" { + cgi.assign = ( + ".sh" => "/bin/sh", + ".cgi" => "/bin/sh" + ) +} + +# Fast CGI modules for PHP. +#fastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" ) +#fastcgi.server = ( ".php" => (( + #"bin-path" => "/usr/bin/php-cgi", + #"socket" => "/tmp/php.socket" + #))) + +# Alias urls for localhost (doc, examples and PHP info). +# +$HTTP["remoteip"] =~ "127.0.0.1" { + alias.url += ( + "/doc/" => "/usr/share/doc/", + "/licenses/" => "/usr/share/licenses/" + ) +} + +#### Virtual hosts +# +# If you want name-based virtual hosting load mod_simple_vhost. +# +# You can directly put vhost in this file or use a sepate one for all +# virtual hosting. +# +#include "vhosts.conf" + +# Example.org +# +#$HTTP["host"] =~ "(^|\.)example\.org$" { + #server.document-root = "/home/vhost/exemple.com/public" + #server.errorlog = "/home/vhost/exemple.com/error.log" + #accesslog.filename = "/home/vhost/exemple.com/access.log" +#}