summaryrefslogtreecommitdiff
path: root/network/lighttpd2/conf/lighttpd.conf
blob: 1a62342940373508ddeb58037725560224ffea86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# 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", "mod_dirlist", "mod_deflate", "mod_redirect", "mod_rewrite", "mod_vhost", "mod_lua" );
#		mod_access,
#		mod_accesslog,
#		mod_auth,
#		mod_balance,
#		mod_cache_disk_etag,
#		mod_debug,
#		mod_deflate,
#		mod_dirlist,
#		mod_expire,
#		mod_fastcgi,
#		mod_flv,
#		mod_fortune,
#		mod_limit,
#		mod_lua,
#		mod_memcached,
#		mod_openssl,
#		mod_progress,
#		mod_proxy,
#		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";

	log ["debug" => "", "*" => "/var/log/lighttpd2/error.log"];
	accesslog "/var/log/lighttpd2/access.log";
	accesslog.format "%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"";

	static.exclude_extensions ( ".php", ".pl", ".fcgi", "~", ".inc" );
}

# 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 = {
	phpfpm { fastcgi "unix:/var/run/lighttpd2/php-fpm.sock"; };
};

if req.path == "/status" { status.info; }

include "/etc/lighttpd2/mimetypes.conf";

docroot "/var/www/htdocs-lighttpd";

# 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" );

# 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;

# 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;