
Other Core Options
There are some other core options we can set:
server.bind = "[Hostname, IP address or UNIX socket]".
This directive tells Lighttpd to bind only to specific interfaces. This may be useful if you have more than one network interface and want to bind Lighttpd only on one of them. Valid examples are:
server.bind = "myserver.com" # binds to the IP found at myserver.com server.bind = "192.168.1.81" # binds the network interface at # 192.168.1.81 server.bind = "/tmp/lighttpd.socket" # binds to a UNIX named socket
By default, Lighttpd binds to all network interfaces it can find. Usually, you will have only one interface. Binding to a UNIX named socket can be useful to proxy Lighttpd by some other server.
Setting server.port
can change the port Lighttpd listens at. This might be useful if you cannot run Lighttpd with sufficient permissions to open ports below 1024.
server.port = 1234
The default port for unencrypted HTTP is 80, the alternate unprivileged port is 8080.
server.tag
changes the so-called Server Tag that is sent with each HTTP response. It defaults to Lighttpd [version] (for example, Lighttpd 1.5.0
for version 1.5.0). If you do not want anyone to know you use Lighttpd, you can change it to anything you like.
server.name
tells Lighttpd its hostname. Otherwise, the hostname or IP from the request will be used while processing the response.
server.modules
is a list of modules Lighttpd will load at startup and execute on each request in the exact order they are specified. Modules are the extension mechanism Lighttpd uses to adapt to many different tasks while staying small if only a part of this power is used.
server.indexfiles
may contain a list of filenames (without path) that is searched if the URI matches a directory. So if you set server.indexfiles = ("index.html")
, you can enter http://127.0.0.1/
in your browser and it will still show your index.html
page, given that the file exists and is readable. The first file found is served. Note that this requires the mod_indexfile
module as of version 1.4.