-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlighttpd.conf
115 lines (97 loc) · 4.6 KB
/
lighttpd.conf
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# 888 d8b 888 888 888 888 .d888
# 888 Y8P 888 888 888 888 d88P"
# 888 888 888 888 888 888
# 888 888 .d88b. 88888b. 888888 888888 88888b. .d88888 .d8888b .d88b. 88888b. 888888
# 888 888 d88P"88b 888 "88b 888 888 888 "88b d88" 888 d88P" d88""88b 888 "88b 888
# 888 888 888 888 888 888 888 888 888 888 888 888 888 888 888 888 888 888
# 888 888 Y88b 888 888 888 Y88b. Y88b. 888 d88P Y88b 888 d8b Y88b. Y88..88P 888 888 888
# 888 888 "Y88888 888 888 "Y888 "Y888 88888P" "Y88888 Y8P "Y8888P "Y88P" 888 888 888
# 888 888
# Y8b d88P 888
# "Y88P" 888
#
# -------------------------------------------------------------------------
# Version: 0.1
# File: lighttpd.conf
# Source: https://github.com/devpunks
# Author: Ahmid-Ra (github.com/snuggs)
# Maintainer: devPunks <https://github.com/devpunks>
# Description: Lighttpd web server configuration file.
# -------------------------------------------------------------------------
#
# - Wiki - https://redmine.lighttpd.net/projects/lighttpd/wiki
# - PHP - https://php.net/manual/en/install.unix.lighttpd-14.php
# - FastCGI
# - https://en.m.wikipedia.org/wiki/FastCGI
# - https://fastcgi-archives.github.io/FastCGI_Specification.html
# - https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_fastcgi
# - Includes - https://blog.lighttpd.net/articles/2005/11/25/simplify-your-configfiles-with-includes/
# =========================================================================
var.PREFIX = "/data/data/com.termux/files/usr"
# =========================================================================
# Includes
# =========================================================================
# Include default lighttpd.conf
include PREFIX + "/etc/lighttpd/lighttpd.conf"
# =========================================================================
# Variables
# =========================================================================
var.PORT = 8000
var.CONFIGURATION = PREFIX + "/etc/lighttpd/lighttpd.conf"
var.LOG = PREFIX + "/var/log/lighttpd"
var.BASEDIR = PREFIX + "/home"
var.EXCLUDED = ( "~", ".inc", ".fcgi", ".rb", ".es", ".php" )
var.INDICES = ( "index.html", "index.htm", "index.txt", "README.md" )
# =========================================================================
# Servers
# =========================================================================
server.port := PORT
server.bind := "0.0.0.0" # "localhost"
server.username := "user"
server.groupname := "group"
server.document-root := BASEDIR
index-file.names := INDICES
static-file.exclude-extensions := EXCLUDED
$HTTP["host"] == "localhost" { # localhost conditional
dir-listing.activate = "disable"
# server.document-root = "./"
$HTTP["url"] =~ "^/foo/" {
dir-listing.activate = "enable"
}
} else { } # default
$HTTP["host"] =~ "^(www\.)?localhost(\.com)$" { # www.localhost.com conditional
dir-listing.activate = "disable"
# server.document-root = "./"
}
# =========================================================================
# PHP # include "php.conf"
# =========================================================================
var.policy = (
# "host" => "localhost" ,
# "port" => 9001 , # port number; incremented for each "max-procs" > 1 when "bin-path" is set
"read-timeout" => 30, # sample; default: 0
"write-timeout" => 15, # sample; default: 0
"connect-timeout" => 5, # sample; default: 0
"check-local" => "enable", # (enable|disable)
"socket" => "localhost:9001", # required: either unix "socket" path or "host"+"port"
"bin-path" => "/usr/local/bin/php-cgi",
) # policy
var.host1 = ( "host" => "192.168.1.101", "port" => 8001 )
var.host2 = ( "host" => "192.168.1.102", "port" => 8002 )
var.host1 += policy
var.host2 += policy
fastcgi.debug = 1
fastcgi.server = ( ".php" => ( host1, host2 ) )
fastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php" )
fastcgi.balance = "least-connection" # ("fair", "least-connection", "round-robin", "hash", or "sticky")
# =========================================================================
# Mime Types
# =========================================================================
# If running lighttpd earlier than lighttpd 1.4.71, uncomment (remove '#') to add the following:
#mimetype.assign = (
# ".txt" => "text/plain",
# ".html" => "text/html",
# ".jpg" => "image/jpeg",
# ".png" => "image/png"
#)