標籤:lighttpd cronlog fcgi
官網:
http://www.lighttpd.net/
http://www.cronolog.org
# 安裝依賴包yum -y install libevent libcurl gamin-devel pcre-devel zlib-devel bzip2-devel python-pycurl# 安裝lighttpdcd /usr/local/srctar xf lighttpd-1.4.35.tar.gzcd lighttpd-1.4.35./configure --with-fam --with-bzip2 --with-zlib --with-pcremakemake install# 安裝cronlog日誌 切割tar -zxvf cronolog-1.6.2.tar.gzcd cronolog-1.6.2./configuremakemake install# 安裝cgitar xf fcgi-2.4.0.tar.gz cd fcgi-2.4.0./configuremakemake installecho "/usr/local/lib" >> /etc/ld.so.confldconfig錯誤解決:make時候遇見報錯fcgio.cpp: In destructor ‘virtual fcgi_streambuf::~fcgi_streambuf()‘:fcgio.cpp:50:14: error: ‘EOF‘ was not declared in this scopefcgio.cpp: In member function ‘virtual int fcgi_streambuf::overflow(int)‘:fcgio.cpp:70:72: error: ‘EOF‘ was not declared in this scopefcgio.cpp:75:14: error: ‘EOF‘ was not declared in this scopefcgio.cpp: In member function ‘virtual int fcgi_streambuf::sync()‘:fcgio.cpp:86:18: error: ‘EOF‘ was not declared in this scopefcgio.cpp:87:41: error: ‘EOF‘ was not declared in this scopefcgio.cpp: In member function ‘virtual int fcgi_streambuf::underflow()‘:fcgio.cpp:113:35: error: ‘EOF‘ was not declared in this scope解決方案: 修改源碼include/fcgio.h 包含標頭檔#include <cstdio>,在make && make install,問題解決。# 檢測lighttpd配置 檔案文法/usr/local/sbin/lighttpd -f /data0/test.com/conf/lighttpd.conf -t# 啟動/usr/local/sbin/lighttpd -f /data0/test.com/conf/lighttpd.conf# 設定檔樣本:# vim lighttpd.confserver.modules = ( "mod_alias", "mod_access", "mod_fastcgi", "mod_extforward", "mod_accesslog" )server.document-root = "/data0/test.com/wwwroot/" extforward.forwarder = ( "1.1.1.1" => "trust", "2.2.2.2" => "trust" )server.errorlog = "/data0/log/test.com/error.log"index-file.names = ( "index.php", "index.html", "index.htm", "default.htm" )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", ".gz" => "application/x-gzip", ".pac" => "application/x-ns-proxy-autoconfig", ".swf" => "application/x-shockwave-flash", ".tar.gz" => "application/x-tgz", ".tgz" => "application/x-tgz", ".tar" => "application/x-tar", ".zip" => "application/zip", ".mp3" => "audio/mpeg", ".m3u" => "audio/x-mpegurl", ".wma" => "audio/x-ms-wma", ".wax" => "audio/x-ms-wax", ".ogg" => "application/ogg", ".wav" => "audio/x-wav", ".gif" => "image/gif", ".jar" => "application/x-java-archive", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".png" => "image/png", ".xbm" => "image/x-xbitmap", ".xpm" => "image/x-xpixmap", ".xwd" => "image/x-xwindowdump", ".css" => "text/css", ".html" => "text/html", ".htm" => "text/html", ".js" => "text/javascript", ".asc" => "text/plain", ".c" => "text/plain", ".cpp" => "text/plain", ".log" => "text/plain", ".conf" => "text/plain", ".text" => "text/plain", ".txt" => "text/plain", ".dtd" => "text/xml", ".xml" => "text/xml", ".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", ".bz2" => "application/x-bzip", ".tbz" => "application/x-bzip-compressed-tar", ".tar.bz2" => "application/x-bzip-compressed-tar", # default mime type "" => "application/octet-stream", )accesslog.filename = "|/usr/local/sbin/cronolog /data0/log/test.com/access.log.%Y%m%d"url.access-deny = ( "~", ".inc" )$HTTP["url"] =~ "\.pdf$" { server.range-requests = "disable"}alias.url += ( "/cgi-bin/" => "/data0/test.com/cgi-bin/" )static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )server.port = 81fastcgi.server = ( "query_isp.fcgi" => ( "localhost" => ( "socket" => "/tmp/query_isp.socket", "bin-path" => "/data0/test.com/cgi-bin/query_isp.fcgi", "min-procs" => 20, "max-procs" => 20, "max-load-per-proc" => 100, "idle-timeout" => 20, ) ), "iplookup.fcgi" => ( "localhost" => ( "socket" => "/tmp/iplookup.socket", "bin-path" => "/data0/test.com/cgi-bin/iplookup.fcgi", "min-procs" => 20, "max-procs" => 20, "max-load-per-proc" => 100, "idle-timeout" => 20, ) ) )
lighttpd安裝配置