diff options
Diffstat (limited to 'network/lighttpd2/conf/lighttpd.conf')
-rw-r--r-- | network/lighttpd2/conf/lighttpd.conf | 58 |
1 files changed, 48 insertions, 10 deletions
diff --git a/network/lighttpd2/conf/lighttpd.conf b/network/lighttpd2/conf/lighttpd.conf index 20b47e840e..1a62342940 100644 --- a/network/lighttpd2/conf/lighttpd.conf +++ b/network/lighttpd2/conf/lighttpd.conf @@ -1,7 +1,13 @@ +# Sample /etc/lighttpd2/lighttpd.conf file +# Assembled and commented by Matteo Bernardini <ponce@slackbuilds.org> +# Default modules here should cover most needs: if you want to cut +# down some, consider that mod_access and mod_accesslog are mandatory. +# http://redmine.lighttpd.net/projects/lighttpd2/wiki/Modules setup { - module_load ( "mod_fastcgi", "mod_status", "mod_access", "mod_accesslog" ); + module_load ( "mod_fastcgi", "mod_status", "mod_access", "mod_accesslog", "mod_dirlist", "mod_deflate", "mod_redirect", "mod_rewrite", "mod_vhost", "mod_lua" ); # mod_access, +# mod_accesslog, # mod_auth, # mod_balance, # mod_cache_disk_etag, @@ -9,6 +15,7 @@ setup { # mod_deflate, # mod_dirlist, # mod_expire, +# mod_fastcgi, # mod_flv, # mod_fortune, # mod_limit, @@ -20,9 +27,12 @@ setup { # mod_redirect, # mod_rewrite, # mod_scgi, +# mod_status, # mod_userdir, # mod_vhost, + lua.plugin "/etc/lighttpd2/php-fpm.lua"; + listen "0.0.0.0:80"; listen "[::]:80"; @@ -33,13 +43,12 @@ setup { static.exclude_extensions ( ".php", ".pl", ".fcgi", "~", ".inc" ); } -# named action block +# http://redmine.lighttpd.net/projects/lighttpd2/wiki/Conditions + +# Run php through php-fpm: be sure to read README.SLACKWARE +# http://redmine.lighttpd.net/projects/lighttpd2/wiki/Howto_PHP php = { - if phys.path =$ ".php" { - if physical.is_file { - fastcgi "unix:/var/run/lighttpd2/www-default-php.sock"; - } - } + phpfpm { fastcgi "unix:/var/run/lighttpd2/php-fpm.sock"; }; }; if req.path == "/status" { status.info; } @@ -48,10 +57,39 @@ include "/etc/lighttpd2/mimetypes.conf"; docroot "/var/www/htdocs-lighttpd"; -index ( "index.php", "index.html", "default.html" ); +# If you install phpmyadmin from the SBo script, it should go there. +# Uncomment below, after having installed. +#alias ( "/phpmyadmin" => "/var/www/htdocs/phpmyadmin" ); + +# Directory listings are enabled by default only for an eventual +# "pub" folder in the docroot: change as needed. +# http://redmine.lighttpd.net/projects/lighttpd2/wiki/Mod_dirlist +if req.path =~ "^/pub/" { + dirlist; +} + +# Directory index files: this commented below can be useful if you +# enable php. +#index ( "index.php", "index.html" ); +index ( "index.html" ); -# alias "/phpmyadmin" => "/var/www/htdocs/phpmyadmin"; +# If you want to use urls like http://example.com/index.php/some/path +# (using your php files like directories), you need this (ex. wordpress) +#pathinfo; -php; +# Some useful rules to avoid access to sensitive files from remote. +# This example still applies to wordpress +#if req.remoteip != "127.0.0.1" { +# if req.path =~ "^/wp-includes/" { access.deny; } +#} +# Deny access to some file-extensions +# ~ 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 +if phys.path =$ "~" or phys.path =$ ".inc" { + if phys.is_file { access.deny; } +} +# Uncomment this to enable php +#php; |