lighttpd
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lighttpd [2019/11/26 22:56] – francesco | lighttpd [2020/09/17 08:35] (current) – francesco | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Per qualche mese ho usato questo | + | Per qualche mese ho usato questo |
| Questo era il file di configurazione: | Questo era il file di configurazione: | ||
| Line 677: | Line 677: | ||
| ## | ## | ||
| ####################################################################### | ####################################################################### | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | Questo invece è il file di configurazione per una macchina virtuale ospitata sull' | ||
| + | |||
| + | < | ||
| + | root@freebsd: | ||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## / | ||
| + | ## | ||
| + | ## check / | ||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Some Variable definition which will make chrooting easier. | ||
| + | ## | ||
| + | ## if you add a variable here. Add the corresponding variable in the | ||
| + | ## chroot example aswell. | ||
| + | ## | ||
| + | var.log_root | ||
| + | var.server_root = "/ | ||
| + | var.state_dir | ||
| + | var.home_dir | ||
| + | var.conf_dir | ||
| + | |||
| + | ## | ||
| + | ## run the server chrooted. | ||
| + | ## | ||
| + | ## This requires root permissions during startup. | ||
| + | ## | ||
| + | ## If you run Chrooted set the the variables to directories relative to | ||
| + | ## the chroot dir. | ||
| + | ## | ||
| + | ## example chroot configuration: | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Some additional variables to make the configuration easier | ||
| + | ## | ||
| + | |||
| + | ## | ||
| + | ## Base directory for all virtual hosts | ||
| + | ## | ||
| + | ## used in: | ||
| + | ## conf.d/ | ||
| + | ## conf.d/ | ||
| + | ## vhosts.d/ | ||
| + | ## | ||
| + | var.vhosts_dir | ||
| + | |||
| + | ## | ||
| + | ## Cache for mod_compress | ||
| + | ## | ||
| + | ## used in: | ||
| + | ## conf.d/ | ||
| + | ## | ||
| + | var.cache_dir | ||
| + | |||
| + | ## | ||
| + | ## Base directory for sockets. | ||
| + | ## | ||
| + | ## used in: | ||
| + | ## conf.d/ | ||
| + | ## conf.d/ | ||
| + | ## | ||
| + | var.socket_dir | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Load the modules. | ||
| + | include " | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Basic Configuration | ||
| + | ## --------------------- | ||
| + | ## | ||
| + | server.port = 80 | ||
| + | |||
| + | ## | ||
| + | ## Use IPv6? | ||
| + | ## | ||
| + | server.use-ipv6 = " | ||
| + | |||
| + | ## | ||
| + | ## bind to a specific IP | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Run as a different username/ | ||
| + | ## This requires root permissions during startup. | ||
| + | ## | ||
| + | server.username | ||
| + | server.groupname = " | ||
| + | |||
| + | ## | ||
| + | ## Enable lighttpd to serve requests on sockets received from systemd | ||
| + | ## https:// | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## enable core files. | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Document root | ||
| + | ## | ||
| + | ### server.document-root = "/ | ||
| + | |||
| + | server.document-root = "/ | ||
| + | |||
| + | ## | ||
| + | ## The value for the " | ||
| + | ## | ||
| + | ## It would be nice to keep it at " | ||
| + | ## | ||
| + | #server.tag = " | ||
| + | |||
| + | ## | ||
| + | ## store a pid file | ||
| + | ## | ||
| + | server.pid-file = state_dir + "/ | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Logging Options | ||
| + | ## ------------------ | ||
| + | ## | ||
| + | ## all logging options can be overwritten per vhost. | ||
| + | ## | ||
| + | ## Path to the error log file | ||
| + | ## | ||
| + | server.errorlog | ||
| + | |||
| + | ## | ||
| + | ## If you want to log to syslog you have to unset the | ||
| + | ## server.errorlog setting and uncomment the next line. | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Access log config | ||
| + | ## | ||
| + | include " | ||
| + | |||
| + | ## | ||
| + | ## The debug options are moved into their own file. | ||
| + | ## see conf.d/ | ||
| + | ## | ||
| + | include " | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Tuning/ | ||
| + | ## -------------------- | ||
| + | ## | ||
| + | ## corresponding documentation: | ||
| + | ## https:// | ||
| + | ## | ||
| + | ## set the event-handler (read the performance section in the manual) | ||
| + | ## | ||
| + | ## possible options on linux are: | ||
| + | ## | ||
| + | ## select | ||
| + | ## poll | ||
| + | ## linux-sysepoll | ||
| + | ## | ||
| + | ## linux-sysepoll is recommended on kernel 2.6. | ||
| + | ## | ||
| + | server.event-handler = " | ||
| + | |||
| + | ## | ||
| + | ## The basic network interface for all platforms at the syscalls read() | ||
| + | ## and write(). Every modern OS provides its own syscall to help network | ||
| + | ## servers transfer files as fast as possible | ||
| + | ## | ||
| + | ## sendfile | ||
| + | ## writev | ||
| + | ## | ||
| + | server.network-backend = " | ||
| + | |||
| + | ## | ||
| + | ## As lighttpd is a single-threaded server, its main resource limit is | ||
| + | ## the number of file descriptors, | ||
| + | ## most systems). | ||
| + | ## | ||
| + | ## If you are running a high-traffic site you might want to increase this | ||
| + | ## limit by setting server.max-fds. | ||
| + | ## | ||
| + | ## Changing this setting requires root permissions on startup. see | ||
| + | ## server.username/ | ||
| + | ## | ||
| + | ## By default lighttpd would not change the operation system default. | ||
| + | ## But setting it to 2048 is a better default for busy servers. | ||
| + | ## | ||
| + | server.max-fds = 2048 | ||
| + | |||
| + | ## | ||
| + | ## listen-backlog is the size of the listen() backlog queue requested when | ||
| + | ## the lighttpd server ask the kernel to listen() on the provided network | ||
| + | ## address. | ||
| + | ## backlog queue and wait for the lighttpd server to accept() the connection. | ||
| + | ## | ||
| + | ## The out-of-box default on many operating systems is 128 and is identified | ||
| + | ## as SOMAXCONN. | ||
| + | ## cat / | ||
| + | ## system limit will be silently reduced to the limit by the operating system. | ||
| + | ## | ||
| + | ## When there are too many connection attempts waiting for the server to | ||
| + | ## accept() new connections, | ||
| + | ## rejects additional connection attempts. | ||
| + | ## indication to an upstream load balancer that the server is busy, and | ||
| + | ## possibly overloaded. | ||
| + | ## server.listen-backlog. | ||
| + | ## able to handle bursts of new connections, | ||
| + | ## that the server can keep up with responding in a reasonable amount of | ||
| + | ## time. Otherwise, clients may abandon the connection attempts and the | ||
| + | ## server will waste resources servicing abandoned connections. | ||
| + | ## | ||
| + | ## It is best to leave this setting at its default unless you have modelled | ||
| + | ## your traffic and tested that changing this benefits your traffic patterns. | ||
| + | ## | ||
| + | ## Default: 1024 | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Stat() call caching. | ||
| + | ## | ||
| + | ## lighttpd can utilize FAM/Gamin to cache stat call. | ||
| + | ## | ||
| + | ## possible values are: | ||
| + | ## disable, simple or fam. | ||
| + | ## | ||
| + | server.stat-cache-engine = " | ||
| + | |||
| + | ## | ||
| + | ## Fine tuning for the request handling | ||
| + | ## | ||
| + | ## max-connections == max-fds/2 (maybe /3) | ||
| + | ## means the other file handles are used for fastcgi/ | ||
| + | ## | ||
| + | server.max-connections = 1024 | ||
| + | |||
| + | ## | ||
| + | ## How many seconds to keep a keep-alive connection open, | ||
| + | ## until we consider it idle. | ||
| + | ## | ||
| + | ## Default: 5 | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## How many keep-alive requests until closing the connection. | ||
| + | ## | ||
| + | ## Default: 16 | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Maximum size of a request in kilobytes. | ||
| + | ## By default it is unlimited (0). | ||
| + | ## | ||
| + | ## Uploads to your server cant be larger than this value. | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Time to read from a socket before we consider it idle. | ||
| + | ## | ||
| + | ## Default: 60 | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Time to write to a socket before we consider it idle. | ||
| + | ## | ||
| + | ## Default: 360 | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Traffic Shaping | ||
| + | ## ----------------- | ||
| + | ## | ||
| + | ## see / | ||
| + | ## | ||
| + | ## Values are in kilobyte per second. | ||
| + | ## | ||
| + | ## Keep in mind that a limit below 32kB/s might actually limit the | ||
| + | ## traffic to 32kB/s. This is caused by the size of the TCP send | ||
| + | ## buffer. | ||
| + | ## | ||
| + | ## per server: | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## per connection: | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Filename/ | ||
| + | ## ------------------------ | ||
| + | |||
| + | ## | ||
| + | ## files to check for if .../ is requested | ||
| + | ## index-file.names | ||
| + | ## " | ||
| + | ## | ||
| + | index-file.names += ( | ||
| + | " | ||
| + | ) | ||
| + | |||
| + | ## | ||
| + | ## deny access the 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 | ||
| + | url.access-deny | ||
| + | |||
| + | ## | ||
| + | ## disable range requests for pdf files | ||
| + | ## workaround for a bug in the Acrobat Reader plugin. | ||
| + | ## | ||
| + | $HTTP[" | ||
| + | server.range-requests = " | ||
| + | } | ||
| + | |||
| + | ## | ||
| + | ## url handling modules (rewrite, redirect) | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## both rewrite/ | ||
| + | ## | ||
| + | # | ||
| + | # url.redirect | ||
| + | #} | ||
| + | |||
| + | ## | ||
| + | ## which extensions should not be handle via static-file transfer | ||
| + | ## | ||
| + | ## .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi | ||
| + | ## | ||
| + | static-file.exclude-extensions = ( " | ||
| + | |||
| + | ## | ||
| + | ## error-handler for all status 400-599 | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## error-handler for status 404 | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## Format: < | ||
| + | ## -> ..../ | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## mimetype mapping | ||
| + | ## | ||
| + | include " | ||
| + | |||
| + | ## | ||
| + | ## directory listing configuration | ||
| + | ## | ||
| + | include " | ||
| + | |||
| + | ## | ||
| + | ## Should lighttpd follow symlinks? | ||
| + | ## | ||
| + | server.follow-symlink = " | ||
| + | |||
| + | ## | ||
| + | ## force all filenames to be lowercase? | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## defaults to /var/tmp as we assume it is a local harddisk | ||
| + | ## | ||
| + | server.upload-dirs = ( "/ | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## SSL Support | ||
| + | ## ------------- | ||
| + | ## | ||
| + | ## To enable SSL for the whole server you have to provide a valid | ||
| + | ## certificate and have to enable the SSL engine.:: | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## # Check your cipher list with: openssl ciphers -v ' | ||
| + | ## # (use single quotes as your shell won't like ! in double quotes) | ||
| + | ## # | ||
| + | ## | ||
| + | ## # (recommended to accept only TLSv1.2 and TLSv1.3) | ||
| + | ## # | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## | ||
| + | ## } | ||
| + | ## | ||
| + | |||
| + | ## If you have a .crt and a .key file, specify both ssl.pemfile and ssl.privkey, | ||
| + | ## or cat them together into a single PEM file: | ||
| + | ## $ cat / | ||
| + | ## > / | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | # or | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## optionally pass the CA certificate here. | ||
| + | ## | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ## and the CRL revocation list here. | ||
| + | ## | ||
| + | ## | ||
| + | # | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## custom includes like vhosts. | ||
| + | ## | ||
| + | #include " | ||
| + | #include "/ | ||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | # IPv4 listening socket | ||
| + | $SERVER[" | ||
| + | </ | ||
| + | |||
| + | **È inoltre necessario modificare anche il file**: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | per attivare il modulo FastCGI | ||
| + | |||
| + | < | ||
| + | root@freebsd:/ | ||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Modules to load | ||
| + | ## ----------------- | ||
| + | ## | ||
| + | ## at least mod_access and mod_accesslog should be loaded | ||
| + | ## all other module should only be loaded if really neccesary | ||
| + | ## | ||
| + | ## - saves some time | ||
| + | ## - saves memory | ||
| + | ## | ||
| + | ## the default module set contains: | ||
| + | ## | ||
| + | ## " | ||
| + | ## | ||
| + | ## you dont have to include those modules in your list | ||
| + | ## | ||
| + | ## Modules, which are pulled in via conf.d/ | ||
| + | ## | ||
| + | ## - mod_accesslog | ||
| + | ## - mod_compress | ||
| + | ## - mod_status | ||
| + | ## - mod_webdav | ||
| + | ## - mod_cml | ||
| + | ## - mod_evhost | ||
| + | ## - mod_simple_vhost | ||
| + | ## - mod_mysql_vhost | ||
| + | ## - mod_trigger_b4_dl -> conf.d/ | ||
| + | ## - mod_userdir | ||
| + | ## - mod_rrdtool | ||
| + | ## - mod_ssi | ||
| + | ## - mod_cgi | ||
| + | ## - mod_scgi | ||
| + | ## - mod_fastcgi | ||
| + | ## - mod_proxy | ||
| + | ## - mod_secdownload | ||
| + | ## - mod_expire | ||
| + | ## | ||
| + | ## NOTE: The order of modules in server.modules is important. | ||
| + | ## | ||
| + | ## Modules which gate requests (e.g. mod_access, mod_auth) or modify | ||
| + | ## requests (e.g. mod_alias, mod_setenv) should be listed before | ||
| + | ## modules which complete requests (e.g. mod_redirect, | ||
| + | ## and which, in turn, should be listed before dynamic handlers | ||
| + | ## (e.g. mod_cgi, mod_fastcgi, | ||
| + | ## | ||
| + | |||
| + | server.modules = ( | ||
| + | " | ||
| + | " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | # " | ||
| + | ) | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## Config for various Modules | ||
| + | ## | ||
| + | |||
| + | ## | ||
| + | ## mod_geoip | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_ssi | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_status | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_webdav | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_compress | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_userdir | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_magnet | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_cml | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_rrdtool | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_proxy | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_expire | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_secdownload | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## CGI modules | ||
| + | ## | ||
| + | |||
| + | ## | ||
| + | ## SCGI (mod_scgi) | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## FastCGI (mod_fastcgi) | ||
| + | ## | ||
| + | include " | ||
| + | |||
| + | ## | ||
| + | ## plain old CGI (mod_cgi) | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ####################################################################### | ||
| + | |||
| + | ####################################################################### | ||
| + | ## | ||
| + | ## VHost Modules | ||
| + | ## | ||
| + | ## Only load ONE of them! | ||
| + | ## ======================== | ||
| + | ## | ||
| + | |||
| + | ## | ||
| + | ## You can use conditionals for vhosts aswell. | ||
| + | ## | ||
| + | ## see https:// | ||
| + | ## | ||
| + | |||
| + | ## | ||
| + | ## mod_evhost | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_simple_vhost | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ## mod_mysql_vhost | ||
| + | ## | ||
| + | #include " | ||
| + | |||
| + | ## | ||
| + | ################################ | ||
| </ | </ | ||
lighttpd.1574805372.txt.gz · Last modified: by francesco
