aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/docs/lighttpd.sample.conf
blob: f5b509e0027bc4237ce008be5fe86c677e35ef5a (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
# Sample lighttpd configuration file for phpBB.
# Global settings have been removed, copy them
# from your system's lighttpd.conf.
# Tested with lighttpd 1.4.35

# If you want to use the X-Sendfile feature,
# uncomment the 'allow-x-send-file' for the fastcgi
# server below and add the following to your config.php
#
#  define('PHPBB_ENABLE_X_SENDFILE', true);
#
# See http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
# for the details on X-Sendfile.

# Load moules
server.modules += ( 
	"mod_access",
	"mod_fastcgi",
	"mod_rewrite",
	"mod_accesslog"
)

# If you have domains with and without www prefix,
# redirect one to the other.
$HTTP["host"] =~ "^(myforums\.com)$" {
	url.redirect = (
		".*"	=> "http://www.%1$0"
	)
}

$HTTP["host"] == "www.myforums.com" {
	server.name				= "www.myforums.com"
	server.document-root	= "/path/to/phpbb"
	server.dir-listing		= "disable"
	
	index-file.names		= ( "index.php", "index.htm", "index.html" )
	accesslog.filename		= "/var/log/lighttpd/access-www.myforums.com.log"
	
	# Deny access to internal phpbb files.	
	$HTTP["url"] =~ "^/(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store|vendor)" {
		url.access-deny = ( "" )
	}

	# Deny access to version control system directories.
	$HTTP["url"] =~ "/\.svn|/\.git" {
		url.access-deny = ( "" )
	}
	
	# Deny access to apache configuration files.
	$HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" {
		url.access-deny = ( "" )
	}
	
	# The following 3 lines will rewrite URLs passed through the front controller
	# to not require app.php in the actual URL. In other words, a controller is
	# by default accessed at /app.php/my/controller, but can also be accessed at
	# /my/controller
	url.rewrite-if-not-file = (
	   "^/(.*)$" => "/app.php/$1"
	)
	
	fastcgi.server = ( ".php" => 
		((
			"bin-path" => "/usr/bin/php-cgi",
			"socket" => "/tmp/php.socket",
			"max-procs" => 4,
			"idle-timeout" => 30,
			"bin-environment" => ( 
				"PHP_FCGI_CHILDREN" => "10",
				"PHP_FCGI_MAX_REQUESTS" => "10000"
			),
			"bin-copy-environment" => (
				"PATH", "SHELL", "USER"
			),
			#"allow-x-send-file" => "enable",
			"broken-scriptfilename" => "enable"
		))
	)
}