cat > /etc/lighttpd/lighttpd.conf << "EOF" server.username = "www-data" server.groupname = "www-data" server.document-root = "/var/www/domain/htdocs/" server.pid-file = "/var/run/lighttpd.pid" server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" server.stat-cache-engine = "fam" server.event-handler = "linux-sysepoll" server.name = "domain.tld" server.max-fds = 2048 evasive.max-conns-per-ip = 10 server.follow-symlink = "enable" server.max-keep-alive-idle = 10 server.modules = ( "mod_access", "mod_status", "mod_cgi", "mod_alias", "mod_auth", "mod_evasive", "mod_proxy_core", "mod_proxy_backend_fastcgi", "mod_proxy_backend_ajp13", "mod_deflate", "mod_accesslog" ) server.indexfiles = ( "index.xhtml", "index.html", "index.htm", "index.php", ) mimetype.assign = ( ".pdf" => "application/pdf", ".sig" => "application/pgp-signature", ".spl" => "application/futuresplash", ".class" => "application/octet-stream", ".ps" => "application/postscript", ".torrent" => "application/x-bittorrent", ".dvi" => "application/x-dvi", ".pac" => "application/x-ns-proxy-autoconfig", ".swf" => "application/x-shockwave-flash", ".tgz" => "application/x-tgz", ".mp3" => "audio/mpeg", ".m3u" => "audio/x-mpegurl", ".wma" => "audio/x-ms-wma", ".wax" => "audio/x-ms-wax", ".ogg" => "application/ogg", ".wav" => "audio/x-wav", ".xbm" => "image/x-xbitmap", ".xpm" => "image/x-xpixmap", ".xwd" => "image/x-xwindowdump", ".asc" => "text/plain", ".c" => "text/plain", ".h" => "text/plain", ".cc" => "text/plain", ".cpp" => "text/plain", ".hh" => "text/plain", ".hpp" => "text/plain", ".conf" => "text/plain", ".log" => "text/plain", ".text" => "text/plain", ".txt" => "text/plain", ".diff" => "text/plain", ".patch" => "text/plain", ".ebuild" => "text/plain", ".eclass" => "text/plain", ".rtf" => "application/rtf", ".bmp" => "image/bmp", ".tif" => "image/tiff", ".tiff" => "image/tiff", ".ico" => "image/x-icon", ".mpeg" => "video/mpeg", ".mpg" => "video/mpeg", ".mov" => "video/quicktime", ".qt" => "video/quicktime", ".avi" => "video/x-msvideo", ".asf" => "video/x-ms-asf", ".asx" => "video/x-ms-asf", ".wmv" => "video/x-ms-wmv", ".tbz" => "application/x-bzip-compressed-tar", ".tar.bz2" => "application/x-bzip-compressed-tar", ".tar.gz" => "application/x-tgz", ".bz2" => "application/x-bzip", ".gz" => "application/x-gzip", ".tar" => "application/x-tar", ".zip" => "application/zip", ".jpeg" => "image/jpeg", ".jpg" => "image/jpeg", ".png" => "image/png", ".gif" => "image/gif", ".xhtml" => "text/html", ".html" => "text/html", ".htm" => "text/html", ".dtd" => "text/xml", ".xml" => "text/xml", ".css" => "text/css", ".js" => "text/javascript", ".deb" => "application/x-deb", ".php" => "application/x-httpd-php", "" => "text/plain", ) static-file.exclude-extensions = ( ".pl", ".cgi", ".fcgi", ".php", ) url.access-deny = ( "~", ".ini", ".inc", ".cfg", ".tpl", ".bak", ".dist", ".orig", ".htaccess", ".htpasswd", ".example", ".sample", ".lang", ) $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/ssl/lighttpd.pem" server.document-root = "/var/www/ox/htdocs/" alias.url += ( "/cgi-bin/" => "/var/www/ox/cgi-bin/" ) cgi.assign = ( ".pl" => "/usr/bin/perl"), accesslog.filename = "/var/log/lighttpd/ox-access.log" $HTTP["url"] =~ "^/servlet/|^/umin/" { proxy-core.balancer = "round-robin" proxy-core.protocol = "ajp13" proxy-core.backends = ( "localhost:8009" ) proxy-core.max-pool-size = 16 } } $HTTP["url"] =~ "\.php$" { proxy-core.balancer = "round-robin" proxy-core.protocol = "fastcgi" proxy-core.allow-x-sendfile = "enable" proxy-core.backends = ( "unix:/tmp/php-fastcgi.sock" ) proxy-core.max-pool-size = 16 } deflate.enabled = "enable" deflate.compression-level = 9 deflate.mem-level = 9 deflate.window-size = 15 deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" ) deflate.min-compress-size = 200 deflate.work-block-size = 512 deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml") EOF